Paris - Defending champion Novak Djokovic struggled into the French Open last 16 on Friday, downing battling Diego Schwartzman of Argentina 5-7, 6-3, 3-6, 6-1, 6-1.
The second seed endured a rollercoaster of an afternoon on Philippe Chatrier court, picking up warnings for his behaviour as his mindset became as gloomy as the weather.
The 30-year-old, almost undone by 55 unforced errors, eventually triumphed, racking up 12 of the last 14 games as Schwartzman's challenge was foiled by a late back injury.
Djokovic will face either France's Lucas Pouille, the 16th seed, or 19th-seeded Albert Ramos-Vinolas of Spain for a place in the last eight.
"I expected a tough match, there were lots of exchanges from the baseline and the conditions were heavy," said Djokovic who joined in a standing ovation for the beaten Argentine.
"I congratulate Diego on a great battle. He played very, very well."
Schwartzman, a boyish-looking world number 41 standing at just 5ft 7ins (1.70m), had been routed in straight sets by Djokovic in their only other meeting at the 2014 US Open.
But he was fired up on Friday with the heavy, overcast conditions playing into his hands.
He carved a crucial break in the 11th game on his way to sealing the opening set.
Djokovic comfortably levelled before the Argentine, playing in the third round of a Slam for the first time, broke in the eighth game of the third.
The champion sprinted to a 4-0 lead in the fourth before he was warned for unsportsmanlike behaviour by umpire Carlos Ramos having received a time warning earlier in the match.
As light rain fell, Djokovic regained his composure -- despite berating the ball boys - to level the match at two sets each and was quickly a break up in the decider.
In no time, he was 4-1 up and Schwartzman, playing just his fourth career five-set match, began to feel the pace, needing treatment for a back injury which effectively ended his hopes.
Milos Raonic (CAN x5) bt Guillermo Garca-Lpez (ESP) 6-1, 1-0 -- retired
Pablo Carreo-Busta (ESP x20) bt Grigor Dimitrov (BUL x11) 7-5, 6-3, 6-4
Roberto Bautista Agut (ESP x17) bt Jir Vesel (CZE) 6-3, 6-4, 6-3
Rafael Nadal (ESP x4) bt Nikoloz Basilashvili (GEO) 6-0, 6-1, 6-0
Dominic Thiem (AUT x6) bt Steve Johnson (USA x25) 6-1, 7-6 (7/4), 6-3
Horacio Zeballos (ARG) bt David Goffin (BEL x10) 4-5 -- retired
Novak Djokovic (SRB x2) bt Diego Schwartzman (ARG) 5-7, 6-3, 3-6, 6-1, 6-1
Jelena Ostapenko (LAT) bt Lesya Tsurenko (UKR) 6-1, 6-4
Samantha Stosur (AUS x23) bt Bethanie Mattek-Sands (USA) 6-2, 6-2
Garbie Muguruza (ESP x4) bt Yulia Putintseva (KAZ x27) 7-5, 6-2
Kristina Mladenovic (FRA x13) bt Shelby Rogers (USA) 7-5, 4-6, 8-6