Roger Federer was beaten on his return from a two-month break, losing 2-6, 7-6 (8), 6-4 to German veteran Tommy Haas in the second round of the Stuttgart Open on Wednesday.
The 39-year-old Haas, who is playing his last season before retirement, saved nine of the 12 break points he faced and converted two of his three chances to deal the Swiss great just his second defeat of the season.
''I've even shocked myself a bit,'' said Haas, who is ranked 302nd and was given a wild card for the grass-court tournament. ''I'm a bit speechless. It's hard to find words.''
Haas, a two-time Halle champion who hadn't beaten his good friend since the 2012 final in Halle, improved to 4-13 against Federer, who hadn't played since winning the Miami Open in early April.
The 35-year-old Swiss skipped the clay-court season to recuperate from a busy start to the year that saw him capture his 18th Grand Slam at the Australian Open.
Federer claimed his last grass-court title in 2015 in Halle, where he is an eight-time champion.
Earlier Wednesday, Philipp Kohlschreiber upset the fifth-seeded Steve Johnson of the United States 7-6 (3), 5-7, 7-6 (6), while the sixth-seeded Mischa Zverev, another German, defeated qualifier Yannick Hanfmann 7-6 (1), 6-2 to secure his place in the quarterfinals.