Roger Federer lost to Argentine qualifier Federico Delbonis 7-6 (7), 7-6 (4) Saturday in the semifinals of the German Tennis Championships.
Federer, a four-time champion in Hamburg, was outplayed by the 114th-ranked left-hander who advanced to his first career final.
"He played well, he was a little more aggressive," Federer said.
Federer took a wild card for Hamburg after losing in the second round at Wimbledon.
In the final, Delbonis will play Fabio Fognini of Italy. Fognini defeated third-seeded Nicolas Almagro of Spain 6-4, 7-6 (1).
Federer has dropped to No. 5, his lowest ranking in a decade. The 31-year-old Swiss ace's only title this year came on grass before Wimbleon in Halle, Germany.
The defending Wimbledon champion, Federer lost to No. 116 Sergiy Stakhovsky — a player who failed to qualify for Hamburg. It was his earliest Grand Slam defeat in 10 years, and his first loss to a player ranked outside the top 100 since 2005.
Federer changed his racket after Wimbledon, going for a bigger frame. But he struggled in Hamburg, going to three sets in two of his previous three matches.
Delbonis was playing only the second semifinal of his career. But he maintained his composure and gave Federer, the 17-time Grand Slam champion, only two break points, one of which he saved.
Federer broke for a 2-1 lead but was broken right back and had to save two set points to force the tiebreaker. He squandered a 4-2 lead, was unable to convert his one set point and saved three with service winners before Delbonis converted his fourth with a smash after some well-played points.
Federer came under pressure immediately in the second set and had to fend off three break points in his opening service game and another in the sixth. Delbonis saved one break point in the next game with a superb volley winner.
In the tiebreaker, Federer made two straight groundstroke errors and he netted a forehand on Delbonis' first match point.
Delbonis will improve to a career-high ranking of around No. 59, according to the ATP.
Fognini won his first career title in Stuttgart last week and is riding a nine-match winning streak.
"I feel incredible," Fognini said.
The Italian earned his 24th win on clay this season. Fognini is the second Italian to reach the final in Hamburg after Adriano Panatta lost to Manuel Orantes in 1972.
Almagro is second in career clay-court titles among active players with 12. Rafael Nadal has 42.