The 7-6 (4) 7-6 (5) 6-2 victory took three hours and 36 minutes, with Djokovic twice a breakdown in the first set and forced to save a set point in the second.
The 22-time grand-slam champion looked unsettled in windy conditions, while he called the trainer before the third set to have his left thigh massaged, but, as he so often does, he found a way to come out on top. French Open 2023: Novak Djokovic reaches third round amid Kosovo controversy
Djokovic had struggled in his opening set against Marton Fucsovics on Wednesday before breezing through the next two, and it quickly became clear Spaniard Davidovich Fokina would offer a real test.
The 23-year-old, ranked 34, matched his opponent in physical rallies from the baseline and broke for the first time to lead 3-2. Djokovic hit straight back but was broken again at 5-5 after a game that featured three double faults and a time violation.
Again, Davidovich Fokina was unable to serve it out, though, and Djokovic made him pay for the wasted opportunities by winning a tie-break. This time the challenge very much continued in the second set as the pair exchanged breaks of serve three times, with Djokovic unable to clinch it at 5-4.
Davidovich Fokina had one chance to break again and level the match in Djokovic’s next service game but he could not take it and the Serbian again came out on top in a tie-break.
Djokovic let his emotions out, roaring and fist-pumping, but the toll the effort had taken became clear when he called the trainer, applying ice to his left thigh and gesturing sarcastically towards the crowd.
Djokovic looked distinctly uncomfortable at times in the third set but he forged ahead early on and did not let Davidovich Fokina back in, giving a weary celebration when the Spaniard’s resistance finally ran out.
“I knew that it’s going to be a very difficult match, a very physical match,” said Djokovic. “He contested very, very well. He’s an amazing fighter, amazing player. Congratulations to him for fighting. Bad luck but he played a great match.
“Of course, a win is a win, maybe a little bit too much, three hours for two sets. I thought, if I would lose the second set, we’d probably play for five hours. “But you have to be ready. It takes a lot of effort but we all have to believe in ourselves. I’m proud of the performance today for sure.”
It was another day of long matches, with Italian Lorenzo Sonego fighting back from two sets down to defeat seventh seed Andrey Rublev, while Austrian qualifier Sebastian Ofner saw off Fabio Fognini in five sets.
After his epic victory over Stan Wawrinka, Australia’s Thanasi Kokkinakis was involved in another lengthy battle with 11th seed Karen Khachanov but was unable to force a decider, losing out 6-4 6-1 3-6 7-6 (5).
Get breaking news alerts.
You have already subscribed