Two-time champion Novak Djokovic struggled with his serve at times but managed to reach the third round of the Monte Carlo Masters with a scrappy 6-3 4-6 6-4 win over Philipp Kohlschreiber.
Djokovic double-faulted eight times and needed five match points to beat Kohlschreiber, who lost eight of their previous 10 matches but secured a rare win in the third round at Indian Wells last month.
He caused problems again for the top-ranked Djokovic in an error-strewn match which featured eight straight breaks of serve from when Kohlschreiber led 2-1 in the second set.
Midway through that, Djokovic needed treatment for a couple of minutes on his right thumb. He appeared to hurt it while sliding at the baseline during the fifth game.
"We both made a lot of unforced errors, it was not the prettiest match," Djokovic said. "It was pretty rusty, but a win is a win."
After Kohlschreiber dropped serve at the start of the deciding set - the eighth straight service break - Djokovic saved break points before holding for 2-0.
The 15-time Grand Slam champion, who will aim to win a fourth straight major when the French Open starts next month, then upped his level.
He held to love for 4-2 and saved a break point to go 5-3 up, forcing his 35-year-old German opponent to serve to stay in the match.
Kohlschreiber saved a first match point at 30-40 with a sublime drop shot and held.
Serving for the match, Djokovic fluffed another three match points. After finally sealing the victory when Kohlschreiber's return landed long, he whacked the ball away in frustration and then whipped another one up into the crowd.
Djokovic, who lost in the fourth round of the Miami Open last month, seemed irritable at times and smashed his racket into the ground at 4-2 down in the second set. Later in the second, he lobbed his racket at the ball when retrieving a shot at the baseline and inadvertently sent it into the crowd.
He next faces the winner of a second-round match between American Taylor Fritz and Argentina's Diego Schwartzman.
In other second-round play, Argentine Guido Pella downed seventh-seeded Marin Cilic 6-3 5-7 6-1, breaking the imposing Croatian's serve eight times.
Young Australian Alex Popyrin was sent packing by veteran Frenchman Gilles Simon 7-5 6-1 and former French Open champion Stan Wawrinka exited at the hands of Italy's Marco Cecchinato.
There was another upset as Italian qualifier Lorenzo Sonego won 7-6 (7-4) 6-4 against eighth-seeded Russian Karen Khachanov.
In remaining first-round matches, 18-year-old Canadian Felix Auger-Aliassime won 7-5 7-6 (7-5) against Juan Ignacio Londero and next faces No. 3 Alexander Zverev on Wednesday.
Fritz was 6-4, 2-0 ahead against Jo-Wilfried Tsonga when his opponent retired with a lower back injury.
Defending champion Rafael Nadal, who is seeking a record-extending 12th title here, is in second-round action Wednesday against Spanish countryman Roberto Bautista Agut.
Nadal has not played since pulling out with a right knee injury ahead of his Indian Wells semi-final against Roger Federer.