World number one Osaka, bidding to add the French Open to her US and Australian Open titles, came back from a set and 2-4 down to defeat former world number one Victoria Azarenka 4-6, 7-5, 6-3.
Her win came on the back of being just two points from defeat in her tournament opener against Anna Karolina Schmiedlova.
The 21-year-old held her nerve, despite squandering two match points late in the deciding set, to secure a clash against Katerina Siniakova of the Czech Republic.
"I was lucky to have played Victoria twice before. I knew she had been playing well coming into the tournament," said Osaka.
"It was an unfortunate second round draw for me so I am happy to win."
Osaka finished the two-hour 50-minute encounter on Court Suzanne Lenglen with 52 winners and 43 unforced errors.
She becomes the first top seed to win her two opening matches at Roland Garros after losing the first set since Lindsay Davenport in 2005.
"She deserves to be where she is -- she is very powerful and explosive," said 29-year-old Azarenka.
Siniakova, the world number 42, also endured a marathon win, putting out Greek 29th seed Maria Sakkari 7-6 (7/5), 6-7 (8/10), 6-3 in a three-hour 10-minute duel.
Siniakova had trailed 1-5 in the first set before surrendering a 5/2 lead in the second-set tiebreaker.
- Big daddy Djokovic -
Djokovic cruised into the last 32 for the 14th successive year, admitting it had been an emotional day playing for the first time in front of his four-year-old son.
Djokovic, bidding to become just the second man to hold all four Slams at the same time twice, cruised to a 6-1, 6-4, 6-3 win over Swiss lucky loser Henri Laaksonen.
Watching from the player's box on Court Suzanne Lenglen was Djokovic's son Stefan.
"It's a very special day for me as it's the first time in my life that I have played in front of my son," said the 32-year-old Serb after a 23rd straight win at the Slams.
"He showed incredible patience to sit there for an hour and a half. Usually, he's not that patient with tennis."
Djokovic goes on to face Italian qualifier Salvatore Caruso, ranked 147, for a place in the last 16 in Paris.
Thursday was a lot more enjoyable for Djokovic than his last visit to Court Suzanne Lenglen in 2018 when he was knocked out in the quarter-finals by Marco Cecchinato.
Three-time French Open champion Williams thrashed Japanese qualifier Kurumi Nara to step up her bid for a record-equalling 24th Grand Slam title.
The 37-year-old cruised to a 6-3, 6-2 victory and next faces fellow American Sofia Kenin.
"I'm very serious when I play, but I'm happy," said Williams.
A mouthwatering quarter-final clash with Osaka, who famously beat Williams in a dramatic 2018 US Open final, remains a possibility.
Williams hammered 10 aces and 36 winners past world number 238 Nara, who stands a mere 5ft 1in (1.55m).
Defending champion Simona Halep wasted three match points in the second set of her clash with Poland's Magda Linette but eventually prevailed 6-4, 5-7, 6-3.
Fourth seed Dominic Thiem overcame an entertaining challenge from Kazakhstan's Alexander Bublik to reach the third round for the fourth straight year.
The Austrian fourth seed was facing a fifth set when trailing 5-2 in the fourth, but reeled off five straight games to win 6-3, 6-7 (6/8), 6-3, 7-5.
World number 91 Bublik delighted the Court Philippe Chatrier crowd with his wide range of shots, including three underarm serves in the opening set.
The reward for Thiem is a clash against Uruguay's Pablo Cuevas who made it through when British number one Kyle Edmund retired with a knee injury at 7-6 (7/3), 6-3, 2-1 down.
Fifth seeded German Alexander Zverev, a quarter-finalist in 2018, easily disposed of Swedish qualifier Mikael Ymer 6-1, 6-3, 7-6 (7/3).
Juan Martin del Potro, the Argentine eighth seed and a two-time semi-finalist, needed treatment on his right knee against Japan's Yoshihito Nishioka in a three-hour 46-minute thriller.
But he still ground out a 5-7, 6-4, 6-2, 6-7 (5/7), 6-2 win to progress, sending down 17 aces and 69 winners.