German Mayer lost 4-6 6-4 6-2 to Lithuanian Berankis, who served 10 aces despite standing only 5'9".
The players were evenly matched in the opening set. Mayer, ranked 27th in the world against Berankis's position of 123rd, then suffered a crisis of confidence in the second stanza on serve and was beaten by six of those aces.
He improved his first-serve accuracy in the decider but nevertheless lost a greater proportion of those points, winning just 50 per cent compared with Berankis's 85 on his own first serve.
He managed to save three of the five break points he faced, but did not carve out one opportunity to break himself as he dropped out.
Mayer had won their only previous meeting on the ATP Tour in three sets in Brisbane last year, and also won a qualifying match against Berankis in 2009 in Karlsruhe.
Third seed Nicolas Almagro needed only one break of serve to move past Romanian qualifier Marius Copil 6-4 7-6(4) while Australian Lleyton Hewitt disposed of eighth-seeded Finn Jarkko Nieminen 7-6(2) 2-6 6-4.
Sixth seed Mikhail Youzhny of Russia beat home player Patrik Rosenholm 6-0 6-2.
The top seed in Sweden is Jo-Wilfried Tsonga, who faces Go Soeda first up after a first-round bye and is on the brink of qualifying for the ATP Tour finals in London.
In the second round of the ATP Moscow event third seed Viktor Troicki was knocked out 6-1 3-6 6-2 by 112th-ranked Malek Jaziri of Tunisia.
The Serbian, who won the tournament in 2010 and reached the final last year, suffered a nightmare opening set then suffered another crisis of confidence in the decider.
Sixth seed Denis Istomin was also beaten, going down 4-6 6-4 6-3 to Lukas Rosol. Istomin took the first set despite converting only one of his four break points, and saving one himself.
The Uzbek saved three of the Czech's four break chances in the second set and Rosol also took the solitary break in the final set from the only chance earned.
Eighth seed Tatsuma Ito of Japan beat Konstantin Kravchuk of Russia 7-6(7) 2-6 6-3, also in round two.
The top seed in the Russian capital is Alexandr Dolgopolov.
In the opening round of ATP Vienna, fifth seed Fabio Fognini of Italy was ousted by American Donald Young 7-6(8) 6-3 while fourth seed Jurgen Melzer, playing in his home tournament, also crashed out 6-3 3-6 7-6(4) to Gilles Muller of Luxembourg.
Top seed Juan Martin Del Potro was taken to three tiebreaks but managed to triumph over Daniel Brands 6-7(5) 7-6(4) 7-6(6).
The Argentine, who along with second seed Janko Tipsarevic is looking to clinch a spot at the ATP Tour Finals in London at the Austrian event, won 10 break points in the match and failed to convert any of them.
However the German qualifier also failed to break his opponent from five opportunities.
ATP Stockholm results
6-Mikhail Youzhny (Russia) beat Patrik Rosenholm (Sweden) 6-0 6-2
Lleyton Hewitt (Australia) beat 8-Jarkko Nieminen (Finland) 7-6(2) 2-6 6-4
3-Nicolas Almagro (Spain) beat Marius Copil (Romania) 6-4 7-6(4)
Ricardas Berankis (Lithuania) beat 4-Florian Mayer (Germany) 4-6 6-4 6-2
ATP Moscow results
Malek Jaziri (Tunisia) beat 3-Viktor Troicki (Serbia) 6-1 3-6 6-2
Lukas Rosol (Czech Republic) beat 6-Denis Istomin (Uzbekistan) 4-6 6-4 6-3
8-Tatsuma Ito (Japan) beat Konstantin Kravchuk (Russia) 7-6(7) 2-6 6-3
Edouard Roger-Vasselin (France) beat Evgeny Donskoy (Russia) 6-4 4-6 6-3
Flavio Cipolla (Italy) beat Teymuraz Gabashvili (Russia) 6-4 6-4
Ivo Karlovic (Croatia) beat Simone Bolelli (Italy) 6-4 7-6(4)
Jerzy Janowicz (Poland) beat Benjamin Becker (Germany) 7-6(6) 6-3
ATP Vienna results
1-Juan Martin Del Potro (Argentina) beat Daniel Brands (Germany) 6-7(5) 7-6(4) 7-6(6)
Gilles Muller (Luxembourg) beat 4-Jurgen Melzer (Austria) 6-3 3-6 7-6(4)
Ernests Gulbis (Latvia) beat Somdev Devvarman (India) 7-6(6) 6-3
Dominic Thiem (Austria) beat Lukas Lacko (Slovakia) 7-6(3) 6-3
Donald Young (U.S.) beat 5-Fabio Fognini (Italy) 7-6(8) 6-3