Roger Federer found a way to beat Germany's Dominik Koepfer in the French Open, despite being far from his best in a scrappy third-round match.
Federer, 39, lacked fluency and trust in his game before coming through to win 7-6 (7-5) 6-7 (3-7) 7-6 (7-4) 7-5 at a near-empty Roland Garros.
The Swiss 20-time Grand Slam champion clinched victory after three hours and 35 minutes at 00:43 local time.
He will play Italian ninth seed Matteo Berrettini in the last 16.
Berrettini, 25, reached the fourth round at Roland Garros for the first time with a 7-6 (8-6) 6-3 6-4 win over South Korea's Kwon Soon-woo.
After hitting 52 winners against Kwon to continue a fine clay-court season, Madrid runner-up Berrettini will be widely considered the favourite against 2009 champion Federer.
Eighth seed Federer is playing in only his third tournament since January 2020 after two knee surgeries and says he is using Roland Garros to build up fitness for Wimbledon, which starts on his favoured grass surface at the end of this month.
Federer increasingly struggled against Koepfer, ranked 59th in the world, in a gruelling contest that lacked quality and was played in a soulless atmosphere without fans.
In a lengthy opening set, Federer was unable to clinch any of five break points - including a set point in the 10th game - before an untimely double fault from Koepfer allowed the Swiss to nick the tie-break.
The ruthless edge appeared, eventually, in the opening game of the second set when Federer whipped a crosscourt forehand past Koepfer to convert his third break point.
Little separated the pair in another close and cumbersome set. The solid Koepfer was able to draw unforced errors out of the erratic Federer, who also struggled with his usually reliable serve.
Federer's demeanour became increasingly despondent after Koepfer broke in the first game of the third set and he looked to be waning physically as the German remained in control.
Somehow, the Swiss shifted the momentum back in his favour out of nowhere with a break back in the eighth game and, after missing a set point in the 12th, took the third tie-break.
The fourth looked destined for another tie-break before Federer dug deep to pick up his level and win the final three games for victory.
'The night matches start too late' - does Roland Garros need to rethink the late starts?
For the first time, the French Open has introduced daily night sessions which consist of one match starting at 9pm local time under the floodlights on Court Philippe Chatrier.
That meant the third set did not start until shortly after 11pm, eventually finishing not long before 1am, and left many tennis fans on social media platforms wondering who actually benefitted from the late scheduling.
No fans were present on court because of the 9pm curfew imposed by the French government as part of coronavirus restrictions.
"I think these night matches start too late," former British number one Laura Robson said on BBC Radio 5 Live.
"They have got a very quick turnaround, probably get back to the their hotel between 2am and 3am, then have to reset.
"It is not easy, especially when your next opponent has long been and gone.
"I can't imagine this is what Federer was expecting when he walked out on the court, to be there so late. It is one other thing to worry about. Less recovery time and less sleep, with Berrettini to come."
Tournament organisers have been reluctant to put women's matches as the night match, with only one of the six so far - Serena Williams' opener against Irina-Camelia Begu on Monday - not being a men's match.
BBC tennis correspondent Russell Fuller added: "Let's be honest, it is no different than playing the second night match in Melbourne or New York. If you have longer matches there, it goes towards 1am or 2am.
"But here they are just playing one match in the night session. It must be a demand of television that they do start at 9pm.
"I really hope the FFT [French Tennis Federation] realise it is not a good idea and put pressure on their broadcast partners to bring it forward an hour.
"They are looking for a good two hours of entertainment and ideally you have live sport between 9pm and 11pm.
"If you are putting men's matches on, you have to be extremely optimistic to think they will only last two hours and not two and a half or three hours.
"The pragmatic thing is to start them at 8pm."