Rafael Nadal overcame a stubborn Marcos Baghdatis in Stuttgart as he attempts to get his season back on track.
The 29-year-old Spaniard, down to 10th in the world rankings, beat the Cypriot 7-6 (7-5) 6-7 (4-7) 6-2 on grass to reach the Mercedes Cup quarter-finals.
Nadal, who lost to Novak Djokovic in the French Open quarter-finals last week, took charge in the third set.
The 14-time Grand Slam winner will face Australian fifth seed Bernard Tomic, who saw off Tommy Haas 7-6 (8-6) 6-2.
Tomic was taken to a tie-break in the first set of his second round match by 37-year-old Haas, returning after a year out following shoulder surgery, before he progressed.
Nadal, who had a bye into the second round, said: "The first match on grass is always tough. He's a very good player and he'd already played a match.
"I need to be more aggressive, to return better, and to move better.
Nadal, at his lowest ranking since he was 11th as a teenager 10 years ago, faced solid resistance from 2006 Australian Open runner-up Baghdatis and dipped to a 59% first serve in the second set.
But the top seed powered clear after breaking in the fourth game of the decider to win in two hours and 40 minutes.