The fourth-seeded American started slowly Thursday under a closed roof on Court Philippe Chatrier before pulling out a 3-6, 6-3, 6-2 victory over Ana Bogdan.
"I knew I had to fight. She was playing well," Kenin said. "First set just didn't go my way. I couldn't find my rhythm. I knew I needed to somehow change my game or else I'm going to be out. Did not want that, definitely."
She nearly stumbled at the end, too.
Kenin held three match points with Bogdan serving at 5-1 but failed to convert them all. In the next game, Kenin had to save three break points before finally winning on her fourth match point.
"I was getting a bit down on myself,'' Kenin said. "But I guess it helped today.''
Kenin, 21, will next face qualifier Irina Bara, and another victory will equal her best performance at Roland Garros. She reached the fourth round last year in her second appearance at the tournament.
"I have a very complex game. I can do many things on court,'' said Bara, who is making her Grand Slam debut, "and I hope I will bother her with that.''
Even though there were late-morning blue skies for their match, the roof stayed closed over the main court.
Ostapenko won her only major title in 2017 at Roland Garros. That was the most recent year in which she won so much as one match at the clay-court tournament, let alone two, the way she has this week.
"Of course it's in my memory, because it's the biggest win of my career so far, but I have to move forward," Ostapenko said of her 2017 success." And just, like, the world doesn't stop with winning only one Grand Slam. Of course I want to achieve more and I want to be back in top five, top 10.
"Step by step. That's what I'm working on: my consistency. Still being an aggressive player -- I think it can bring me a lot of wins -- but consistency, probably, in my game is the key.''
The 29th-seeded American lost in the second round for her earliest exit at Roland Garros since a first-round defeat in her debut in 2011. Stephens reached the quarterfinals at Roland Garros last year and the final in 2018.
She had reached at least the third round every year since 2012 except for 2017, when she was injured. Stephens won the US Open later that year.
Stephens led Badosa 27-20 in winners but made 36 unforced errors compared to 18 for her unseeded opponent.
In other women's matches, two-time Wimbledon champion Petra Kvitova beat Jasmine Paolini 6-3, 6-3. The seventh-seeded Kvitova reached the semifinals at Roland Garros in 2012. Kvitova next meets 100th-ranked Canadian teen Leylah Fernandez.
Other than former Australian Open champion Caroline Wozniacki, the 17-year-old Tauson was the first Danish woman in the second round of any major tournament since 1989.
The Associated Press contributed to this report.