Roger Federer marked his return to action by tying Ivan Lendl for the second-most match wins in the Open era, but only after surviving a scare against Taylor Fritz at the Stuttgart Open.
The Swiss great missed the French Open because of a back injury and was left frustrated on Wednesday as rain halted his second-round clash with the American teenager when he was a break up at 4-3 on the German grass.
And Federer, making his debut at the tournament, was made to work hard by the 18-year-old, who took the second set before the 17-time grand slam champion prevailed 6-4 5-7 6-4 on Thursday.
Federer promptly closed out the opening set when the match resumed, only for Fritz to hit back in a hard-fought second by registering the sole break to force a decider.
Fritz had chances on Federer's serve in the decider, but he was punished for failing to take advantage as Federer recorded match win number 1,071 - leaving Jimmy Connors (1,256) as the only man ahead of him on the all-time list.
Florian Mayer awaits Federer in the quarter-finals, but second seed Marin Cilic will not join him in the last eight after losing to veteran Radek Stepanek.
Cilic was knocked out in the first round of the French Open and his poor form continued as qualifier Stepanek - who pushed Roland Garros finalist Andy Murray to five sets at the same tournament - won 7-6 (7-4) 7-5.
There were no such problems for third seed Dominic Thiem, who followed up his run to the last four in Paris with a 7-6 (7-3) 7-6 (7-2) defeat of Sam Groth.
Fourth seed Gilles Simon overcame Jan-Lennard Struff 6-4 4-6 6-2 while former US Open champion Juan Martin del Potro was victorious against John Millman in his first match in over a month.
Del Potro skipped the French Open to aid his long-term recovery from a wrist injury that saw him spend 11 months on the sidelines, and had too much for world number 66 Millman in a 6-4 6-4 victory.
Elsewhere in the draw, Mikhail Youzhny beat Sergiy Stakhovsky 6-3 7-6 (7-1).