PARIS -- For the third match in a row at the French Open, Serena Williams was oddly out of sorts at the start and dropped the opening set.
And for the third match in a row, almost as though this was the plan all along, Williams righted herself to pull out a victory.
In a riveting, two-hour showdown between the last two American women in the draw, the No. 1-ranked and No. 1-seeded Williams was a game away from defeat Monday, then came back to beat Sloane Stephens 1-6, 7-5, 6-3. Williams reached the quarterfinals and avoided joining defending champion Maria Sharapova on the way out of Roland Garros.
"It's not how you start, I guess. It's how you finish," Williams said. "That's kind of how I'm looking at it."
Close as it was, thanks in large part to Williams' 43 unforced errors, more than twice as many as Stephens' 21, the eventual outcome seemed certain once Williams pulled even by taking the second set.
That's because Williams is 10-0 in three-set matches this season.
"I feel like I'm living on the edge," Williams said. "But, you know, I've got to get off the edge. I don't really like to live like this.
"Believe me, I'm thinking, 'OK, Serena, pull yourself together.'"
She is 29-1 overall in 2015 and owns an 18-match Grand Slam winning streak, including championships at the US Open last September and Australian Open in January, raising her total to 19 major singles trophies. Only two tennis players won more: Margaret Smith Court (24) and Steffi Graf (22).
"There's a reason," said Stephens, defeated in the French Open's fourth round for the fourth consecutive year, "why she's the No. 1 player in the world."
The two-time French Open champ still has a chance to become only the fifth woman in the Open era to win the year's first two majors -- and the first since Jennifer Capriati in 2001.
Trying to become the first woman to beat both Williams sisters in a Grand Slam event, the 40th-ranked Stephens --who beat older sisterVenusin the first round-- hit a backhand wide to allow Williams to break her serve and take a 3-2 lead in the decidingset.
Stephens, who won the first set in just 23 minutes, threw everything she had at Williams, literally. In the eighth game of the third set, she tossed her racket at a ball that fizzed past her forehand.
Williams, whose 2013 title is her only trip past the quarterfinals here in the past 12 years, will next face 17th-seeded Sara Errani, who reached the French Open quarterfinals for a fourth time with a 6-2, 6-2 victory over Julia Goerges.
Either Williams, in 2013, or Sharapova, in 2012 and 2014, has won the French Open the past three years. Only Williams has a chance to do it again Saturday, because the second-seeded Sharapova was outplayed throughout a 7-6 (3), 6-4 loss to 13th-seeded Lucie Safarova of the Czech Republic earlier Monday.
It was Sharapova's earliest defeat at Roland Garros since 2010, when she was beaten in the third round. Since then, the Russian won the clay-court Grand Slam tournament in 2012 and 2014, was the runner-up to Serena Williamsin 2013 and reached the semifinals in 2011.
"A tough day ... it was a bad day at the office," Sharapova said."My opponent had a different gear than I did."
Safarova dictated much of the action and held her nerve as the far more experienced and accomplished Sharapova tried to mount a comeback in the second set.
"Maria is an amazing player. I needed to play aggressive and to come forward for the points," Safarova said.
The left-handed Safarova wound up with a considerable edge in winners (34-20), including forehands on the last two points to break Sharapova.
"I felt like I had small openings, and I just wasn't able to ... play a good few points. I just wasn't able to keep that level up today," Sharapova said. "She was able to do that for a longer period of time. ... She took the time away from me, created her angles and I didn't. That was the difference today, in my opinion."
She did not use the cold she's been dealing with as an excuse, saying: "I don't like to talk about it, and I don't think it really makes a difference. I'm still a competitor no matter what."
Sharapova, a five-time major champion who completed her career Grand Slam in Paris three years ago, had not lost to Safarova since 2010, winning their four most recent matches. Still, from early on, it was clear Sharapova was not going to have her way this time against Safarova, whose best career showing to date was a semifinal run at Wimbledon last year.
Safarova grabbed 12 of 15 points in one stretch while taking a 3-1 lead, and while Sharapova steadied herself and broke back, she faltered in the tiebreaker.
Safarova was more aggressive during lengthy exchanges at the baseline, opening the tiebreaker with three groundstroke winners in a row, and also benefited from Sharapova's lone double fault of that set.
The second set began similarly, with Safarova breaking to go ahead 2-0, then holding for 3-0. But Sharapova, gritty as can be, did not give up, and when Safarova double-faulted on break point, suddenly it was 3-2.
Some more nerves came from Safarova in the next game, when she had a break point but flubbed a swinging forehand volley off a floater. It was a bad mistake, and Sharapova would wind up holding there for 3-all, yet Safarova managed to smile at her own gaffe.
The winner of Williams-Errani will go up against someone making her Grand Slam semifinal debut, because it'll either be 23rd-seeded Timea Bacsinszky of Switzerland -- who surprised two-time Wimbledon champion Petra Kvitova 2-6, 6-0, 6-3 -- or 100th-ranked Alison Van Uytvanck of Belgium.
At 93rd, Van Uytvanck will be the lowest-ranked quarterfinalist this year by far. The others are all in the top 30.
The Associated Press contributed to this report.