Federer lost to No. 116 Sergiy Stakhovsky a player who failed to qualify for Hamburg as the defending Wimbledon champion.
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 will play Fabio Fognini of Italy, who moved within one win of his second title in two weeks when he beat third-seeded Nicolas Almagro of Spain 6-4, 7-6 (1).
Delbonis was playing only the second semifinal of his career but maintained his composure and gave Federer, the 17-time Grand Slam champ, 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 jump 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.
It was the Italian's 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.