The Swiss 20-time Grand Slam winner, playing at Roland Garros for the first time in four years, beat the Italian 6-2 6-4 6-4.
He arrived to a standing ovation on Philippe Chatrier court and left with the crowd on their feet in delight.
The 37-year-old will play German lucky loser Oscar Otte, ranked 145th in the world, in the second round.
“I knew I can play very well on clay and I am very happy I did it in straight sets today,” Federer said.
“I missed the French crowd so thanks for the warm welcome today.”The rapturous reception he received was the only clue that Federer had ever been away from the Paris clay-court Grand Slam tournament.
The third seed missed the 2016 event with a back injury and skipped the past two clay-court seasons to preserve his body.
He raced to a 4-0 lead in the opening set before Italian world number 73 Sonego finally held his serve.
But while Sonego temporarily stemmed the flow, Federer marched on to claim the opening set in just 24 minutes.
“Two breaks in the first set was very important for me and when I was leading 4-0 I could take more risks and play more aggressive,” Federer said.
He had looked like he was going to race away with the match until Sonego began to find some form when he was a double break down midway through the second set.
A cross-court forehand winner set up three break points for the Italian, all of which Federer saved before Sonego snatched the break when the Swiss double-faulted.