Serena Williams overcame a slow start for a 2-6, 6-1, 6-0 win over 83rd-ranked Vitalia Diatchenko of Russia in her opener.
Williams had completed only three matches since her Australian Open ended four months ago, and she cited a bothersome left knee when pulling out of her past two tournaments.
During an error-filled first set, Williams was constantly shaking her head and yelling at herself.
But the 23-time Grand Slam champion quickly changed the momentum by winning the opening three games of the second set.
After committing 14 unforced errors in the first set, Williams had a total of 10 in the second and third sets.
Afterward, Williams seemed more relieved than pleased at avoiding what would have been only the second loss of her career in the first round of a Grand Slam tournament — after her defeat to Virginie Razzano at Roland Garros in 2012.
Top-ranked Novak Djokovic was in control from the start, beating 44th-ranked Hubert Hurkacz of Poland 6-4, 6-2, 6-2.
It's the 22nd consecutive victory in Grand Slam tournaments for Djokovic, who is attempting to become only the second man in history to hold all four major titles at the same time on two separate occasions.
Rod Laver was the only player to achieve the feat when he won all four Grand Slams in 1962 and 1969.
Djokovic also won four straight majors in 2015-16.
Meanwhile, two-time Wimbledon champion Petra Kvitova pulled out of the French Open ahead of her first-round match because of an injured left forearm.
An MRI on Sunday night confirmed a Grade 2 tear, which she said "could get a lot worse" if she played.
She had been due to face Sorana Cirstea on Court Suzanne Lenglen.
Kvitova was replaced in the draw by Kaja Juvan, an 18-year-old from Slovenia who lost in qualifying and will be making her Grand Slam debut.