Roger Federer's bid for an 11th title on the Halle grass was cut short by 20-year-old Canadian Felix Auger-Aliassime as he fell away after a fine start to 4-6, 6-3, 6-2 on Wednesday.
The 39-year-old impressed on his return to competitive action on grass for the first time since 2019 on Monday when he beat qualifier Ilya Ivashka in straight sets.
But Auger-Aliassime was a step up for the fifth-seeded Swiss who was far from his best in an error-strewn display.
It was the first time in 18 appearances that Federer has failed to reach the quarter-finals in Halle.
Auger-Aliassime, who had never played his idol before, failed to capitalise on his break points in the opening set and dropped his own serve when Federer sent a backhand pass whistling down the line to lead 4-3.
But Auger-Aliassime finally converted a break point at the ninth attempt to take a 4-2 lead in the second set and 20-time Grand Slam champion Federer's level dipped after that.
Federer sent a backhand long to drop serve at the start of the decider and Auger-Aliassime never looked back.
Federer has played only three tournaments this year as he comes back from knee surgery and withdrew from the French Open after reaching the fourth round to focus on Wimbledon.
Fourth seed Andrey Rublev beat Jordan Thompson 6-4, 6-4 to set up a third-round clash with experienced German Philipp Kohlschreiber who beat Corentin Moutet.
Another injury scare at Euro 2020
Euro PIX: Russia back on track after win over Finland
Euro: Controversy behind Arnautovic's goal celebration
Yuvraj moves from cricket to fast lane
Rahul, Athiya: What's up guys?