Novak Djokovic was in the mood for partying after surviving a thriller against Lorenzo Musetti, describing the performance as his greatest French Open showing.

The world number one battled long into the Paris night to secure a 7-5 6-7 (6-8) 2-6 6-3 6-0 victory in four hours and 29 minutes across Saturday and into Sunday.

The third-round marathon finished at 3:08 a.m. local time at Roland-Garros, shattering the tournament's previous latest finish of 1:25 a.m.

This victory also saw Djokovic equal Roger Federer (369) for the most major singles match wins of any male or female player in the Open Era.

"He played a fantastic match and came very close to victory," Djokovic said on court.

"I was in great difficulties but thanks to your support in the fourth set, I became a different player. It was perhaps the best match I have played here."

A stunning fightback also marked Djokovic's 36th five-set win at grand slams – the most of any player in the Open Era.

The 24-time major champion next faces Argentina's Francisco Cerundolo, who advanced to the fourth round for the second consecutive year.

Yet before that, the Serbian wanted to celebrate.

"Who's going to sleep now?" Djokovic added. "It's impossible to sleep, so much adrenaline. If you're having a party, I'm coming."

Djokovic must reach the final in the French capital to remain at the top of the ATP rankings, though Jannik Sinner would overtake him regardless if he reaches the showpiece.