The 36-year-old downed Kristyna Pliskova of the Czech Republic 7-6 (7/4), 6-4 to register her first victory at the majors since her 2017 Australian Open triumph.
It's Williams' first major championship since giving birth in September, and this was was her first match on clay this season. Williams broke in the seventh and held in the eighth to set a 5-3 lead, which she converted on serve to win the second set 6-4.
After trailing 3-0 in the tiebreaker, she reeled off six points in a row.
The 17th-seeded Barty, Australia's top-ranked woman here, withdrew from her semifinal in Strasbourg last week after experiencing back spasms the day before, but told reporters she's ready to play.
Pliskova, a lefty whose twin sister upset Williams in the 2016 US Open semifinals, actually hit more aces, 15. The opening set went with serve and eventually to a tie-break in which Williams bounced back from 3-0 down to clinch it.
French Open organisers stick rigidly to the WTA rankings, so would not seed Williams.More news: Flash flooding likely as Alberto brings heavy afternoon rain
More news: Salah travels to Spain for treatment
More news: 11 people killed and 25 hospitalized due to deadly Nipah virus
The world No.25 looked like suffering her third consecutive first-round defeat at Roland Garros before turning the match around after a 45-minute rain delay.
"I feel like a warrior in it, like a warrior princess kind of, queen from Wakanda maybe".
Well done, Serena. Playback her big win below.
After the match, Williams praised her opponent.
Gavrilova breathed a sigh of relief after staging a tense fightback to break her French Open first-round jinx.
She had deliberately held back from a return, skipping Rome and Madrid, in order to make sure she was ready to compete on what is her least natural surface, training at the academy belonging to her coach, Patrick Mouratoglou. But there was no slip in her game as she closed it on her second match point. "I'm a super hands-on mom", Williams said.
"And I think there are valid arguments both ways".
There are no artificial lights at Roland Garros and organizers figured there might not be enough sunlight to get the women's match started, let alone finished, on Tuesday. She added: "Two years is a long time but I've trained hard on this surface".