Roger Federer survived a stern examination by American teenager Taylor Fritz in Stuttgart on Thursday to win his first match since withdrawing from the French Open with a back injury.
The Swiss 17-times grand slam champion resumed leading 4-3 in the opening set after rain curtailed play at the Mercedes Cup the previous day and he eventually prevailed 6-4 5-7 6-4.
Fritz, 18, levelled the match when he converted his fourth set point but Federer edged home in the decider to set up a quarter-final against Florian Mayer.
Top seed Federer has been struggling with injuries this season, requiring knee surgery in February and then nursing a back problem throughout the claycourt season.
His victory was his 1,071st on the ATP Tour, taking him joint-second on the all-time match wins list with Ivan Lendl.
Jimmy Connors is the overall leader with 1,256 wins.
There was also a win on Thursday for Austrian third seed Dominic Thiem who made the semi-finals of the French Open last week, losing to Novak Djokovic.