Djokovic overcomes struggles to reach French Open fourth round
Djokovic, chasing a third Roland Garros title and men's record 23rd Grand Slam crown, came through 7-6(4), 7-6(5), 6-2 against the 34th-ranked Spaniard.
However, it was a far from vintage performance from the Serb whose first week in the French capital has been overshadowed by his explosive and controversial comments on the Kosovo crisis.
The 36-year-old world number three had to come back from breaks down in both opening sets, saving a set point in the second after Davidovich Fokina had failed to serve for the first.
Djokovic dropped serve five times in the match and drew jeers from the crowd for taking a medical timeout before the start of the third set.
Davidovich Fokina, a quarter-finalist in 2021, matched Djokovic blow for blow in the first two sets which took the best part of three hours to complete.
However, the physical effort took its toll as Djokovic, the champion in 2016 and 2021, swept through the third set.
"I knew it would be a difficult and physical match. We played three hours just for the first two sets. I thought if I lost the second set that we would play for five hours," said Djokovic.
"He's an amazing fighter and there aren't many weaknesses in his game.
"But a win is a win and I am very proud of the way I played today."
Next up for the former world number one is a clash with either Polish 13th seed Hubert Hurkacz or Peru's Juan Pablo Varillas.
Djokovic was sluggish throughout the first set.
He retrieved a break to level in the sixth game but was broken again in the 11th, his low-energy mood not helped by a code violation for taking too long between points.
Davidovich-Fokina, who had defeated the Serb on clay in Monte Carlo last year, was unable to back up his second break of the set and Djokovic, suddenly out of his slumber, claimed the tie-break off a blistering forehand service return.
The first set had taken 85 minutes in which the former champion managed just eight winners.
The second set featured six breaks of serve before Davidovich Fokina squandered a set point in the 12th game.
Djokovic claimed the breaker and bellowed at the crowd. Some spectators then jeered him as he argued with the umpire before calling a medical timeout for treatment on his left thigh.
The Serb, in return, gave the Court Philippe Chatrier fans a sarcastic thumbs up and a round of applause.
Djokovic stretched out to a commanding 3-0 lead in the decider and briefly won back the affection of the crowd when he helped his opponent courtside after a nasty fall.