Roger Federer's Wimbledon preparations hit a setback on Wednesday after the Swiss crashed out of the Halle Open second round with a 4-6, 6-3, 6-2 defeat to Canada's Felix Auger Aliassime.
Federer, 39, has missed much of the past two seasons after undergoing two knee surgeries and he has timed his return to coincide with Wimbledon, where later this month he will be bidding for a record-extending ninth title.
A constant in Federer's lead-up to the grass court Grand Slam over the years has been the Halle Open, although his hopes for an 11th title at the German tournament were dashed by 21-year-old Auger Aliassime.
After taking the first set, courtesy of a break in the seventh game and some typically exquisite shot-making, Federer's level declined significantly. He struggled with his serve, his rhythm disappeared and the errors accumulated.
Federer survived three break points in the fourth game of the second set, but the Swiss was unable to prevent Auger Aliassime taking a 4-2 lead.
From that point, the Canadian was in the ascendency and comfortably levelled the match, before racing into a 4-0 lead in the third set. The remainder of the match went with serve and Auger Aliassime sealed the victory with a love service hold.
"It's a great honour to play Federer before he retires and winning is incredible," Auger Aliassime said. "He was my idol growing up. I never thought I would be able to play him one day. I thought he would be gone when I would be a pro".
Federer, who opted to withdraw from the French Open ahead of the fourth round earlier this month to avoid harming his "road to recovery", now has less than two weeks before the start of Wimbledon on June 28 and the priority will be ensuring he is physically fit and ready.
Should Federer, as expected, take his place among the main draw at Wimbledon, the 20-time Grand Slam champion will be joined at the All England Club by two other former champions after Andy Murray and Venus Williams were granted wildcards.
Britain's Murray won the second of his two Wimbledon titles in 2016 but due to persistent injury problems is now ranked No 124, which is outside the cut-off for direct qualification.
The 34-year-old Scot beat Frenchman Benoit Paire at Queen's Club on Tuesday in his first singles match since March and is back in action on Thursday against Italy's Matteo Berrettini.
Five-time champion Williams, 40, will be competing in her 90th Grand Slam and is ranked 103rd in the world.
The American's French Open campaign came to an early end when she was beaten in the first round by Russia's Ekaterina Alexandrova.