PARIS — Stepping on center court to take on 88th-ranked Damir Dzumhur, Roger Federer was on his guard.

The 17-time Grand Slam champion had been caught cold at a previous French Open by a player ranked as low as the 23-year-old Bosnian, and he made sure that did not happen again. Federer advanced to the fourth round for the 11th straight year with a clinical 6-4, 6-3, 6-2 win Friday.

“I’d never played him before, he moves well, he’s very quick. I didn’t know him and I didn’t know how he’d play on the key points,” said Federer, who lost in the first round in Paris to the 88th-ranked Luis Horna 12 years ago.

“Mentally I’m not always as relaxed as people might think, there is so much at stake,” Federer said.

The 33-year-old Swiss, who is seeded second at the tournament, won his only French Open title in 2009. After winning his first two matches in straight sets, Federer put on another aggressive and solid display, saving four of the five break points he faced.

Federer hit a superb forehand passing shot to earn a match point and sealed it when Dzumhur sent a backhand into the net. Federer will next be up against either 13th-seeded Gael Monfils or No. 21 seed Pablo Cuevas.

After struggling in her first two matches at the French Open, Ana Ivanovic eased past Donna Vekic 6-0, 6-3 in the women’s side of the draw to book a spot in the second week.

On a cold morning in the French capital, it took the former champion just 53 minutes to return to a fourth round at a major tournament for the first time in more than a year.

Ivanovic, who won the French Open in 2008 after losing in the final a year before, wrapped up the first set in 23 minutes and finished with 19 winners.

“After the first two matches, I really started to get a little bit of feeling and groove,” said the Serb, who was pushed to deciders in the first and second rounds after twice losing the opening set.

The last time Ivanovic made the fourth round of a major was at the Australian Open in 2014. She was eliminated by 142nd-ranked Lucie Hradecka in Melbourne earlier this year after playing with a broken toe.

Since winning the title seven years ago, Ivanovic has never progressed past the fourth round in Roland Garros. Her next opponent on the Parisian red clay will be No. 9 seed Ekaterina Makarova, who defeated Elena Vesnina 6-2, 6-4.

Also advancing was defending champion Maria Sharapova. Sharapova is into the French Open fourth round after beating Samantha Stosur of Australia 6-3, 6-4.

The second-seeded Russian has a great record against Stosur, the 26th seed, and has now beaten her 15 times in their 17 meetings.

The 28-year-old Sharapova is seeking her third French Open title, having also won it last year and in 2012, and her sixth overall.

She next plays Lucie Safarova and leads the Czech player 4-1.

In the men’s event, 20th-seeded Richard Gasquet needed 32 minutes to complete a 3-6, 6-3, 6-1, 4-6, 6-1 win over Carlos Berlocq and advance to the third round after an encounter that spanned over two days. The players were locked at two sets apiece when their match was stopped Thursday evening.

“My preparation will be shortened, but everything’s fine for me, I’m physically well,” said Gasquet, who will face 15th-seeded Kevin Anderson in his next match and has just one day to recover.

Also, 74th-ranked Teymuraz Gabashvili equaled his best Grand Slam result, reaching the fourth round with a 6-4, 6-4, 6-4 defeat of Lukas Rosol.