Maria Sharapova will face sixth seed Karolina Pliskova in the French Open third round after beating Donna Vekic 7-5 6-4 on Thursday.
After two breaks apiece in the opening set, Sharapova claimed a crucial third in the 12th game to clinch the first set.
The two-time French Open champion moved into a 5-2 lead in the second set, but failed to serve it out before squandering five match points on Vekic's serve.
However, it was sixth time lucky for the 28th seed, who won the 10th game after six deuces to seal her place in the next round.
The Russian will come up against Pliskova, after the Czech battled from a set down to beat compatriot Lucie Safarova.
Pliskova, who reached the semi-final at Roland Garros last year, fell behind to the world No 53, but battled back to win 3-6 6-4 6-1.
Elsewhere, a routine victory for Simona Halep saw the world No 1 beat American Taylor Townsend 6-3 6-1. The Romanian faces Andrea Petkovic in the third round.
Serena Williams battled back from a set and break down to defeat Australia's Ashleigh Barty 3-6 6-3 6-4 to keep her hopes of a 24th Grand Slam title alive.
The three-time champion and former world No 1, dressed again in her all-black catsuit, will face Germany's Julia Goerges for a place in the last 16.
"I lost the first set and I thought 'I've got to try harder'," she said. "Then Serena came out. "Every day is a great day for me and I'm excited to play singles, or doubles, and fight my heart out."
Earlier in the day, 2016 champion Garbine Muguruza proved too strong for France's Fiona Ferro, with the No 3 seed claiming a 6-4 6-3 victory to set up a match with Samantha Stosur.