PARIS — Novak Djokovic and Rafael Nadal took two very different paths to the fourth round of the French Open on Friday.

Djokovic, the defending champion, was extended to five sets by Argentina’s Diego Schwartzman, ultimately winning 5-7, 6-3, 3-6, 6-1, 6-1. The second-seeded Serb sealed victory on his first match point with a forehand winner down the line, completing the win in 3 hours, 19 minutes.

He gave Schwartzman a hug and a part on the head at the net — and then joined in the applause as the Argentine player walked off Court Philippe Chatrier.

“I was expecting a difficult game with a lot of rallies from the baseline, because the conditions are heavy,” Djokovic said moments after his win. “I want to congratulate Diego for a great battle, because he played very well.”

Djokovic continued his streak of never having lost to an opponent outside the top 40 of the ATP Rankings (now 35-0) at the French Open, but Schwartman, ranked No. 41, didn’t make it easy.

Schwartzman needed some treatment to his back late in the fifth set.

Djokovic earned his 58th career match win at the French Open, tying Guillermo Vilas for third among men in the Open Era.

Nadal, meanwhile, dropped just one game on his way to a straight-sets victory over Nikoloz Basilazhvili in his third-round match on Court Philippe-Chatrier.

It was Nadal’s 100th best-of-five-sets match on clay. He has a 98-2 win-loss record, and he improved to 14-0 in third-round matches at Roland Garros.

With the rain clouds rolling in, Nadal seemed keen to get his third-round match over as quickly as possible, and the No. 4 seed took 90 minutes to win 6-0, 6-1, 6-0.

It was the 15th and 16th time that he’s held an opponent without a win in a set at the French Open over his career.

“I don’t know if it was perfection,” said Nadal, who turns 31 on Saturday.

“I went on court thinking it was going to be a tough match. … I believe I played the best match since a while.”

American Steve Johnson, still grieving the recent death of his father, lost to sixth-seeded Dominic Thiem 6-1, 6-7 (4), 6-3.

The 25th-seeded Johnson had burst into tears after his second-round victory over Borna Coric on Wednesday, but there was no such display of emotion after his loss to Thiem, who spoke to Johnson at the net and gave him a consoling hug.

Fifth-seeded Milos Raonic advanced to the fourth round when opponent Guillermo Garcia-Lopez retired from the match with a left thigh injury.

Raonic was leading 6-1, 1-0 when Garcia-Lopez stopped. The Spaniard had already received treatment at the end of the first set.

It was the second retirement of the day. David Goffin was forced out with an injured right ankle.

Pablo Carreno Busta, the No. 20 seed, earned his first win over a top-20 player in a Grand Slam with a 7-5, 6-3, 6-4 victory over 1tth-seeded Grigor Dimitrov.

Busta, who had been 0-7 vs. top-20 players in Grand Slam events, has never reached the second week of a French Open — the only Slam where he has yet to do so.