Federer saw off Marin Cilic for the 10th time in 11 meetings, winning 6-2, 2-6, 7-6 (7/4), 6-2 but only after a second set bust-up with umpire Emmanuel Joseph.
The 20-time Grand Sam title winner was handed a time violation at 1-3 down in the for taking too long between points.
“I don’t even dare to go my towel anymore,” he said to Joseph.
Federer, the oldest man in the draw at 39, lost his cool and the set before recovering to defeat former world number three Cilic.
Fed the Fighter 👏For a 16th time in Paris, @rogerfederer is safely through to the third round overcoming Cilic 6-… https://t.co/4HhII115yy
— Roland-Garros (@rolandgarros) 1622738688000
“I had very good moments, in the tie-break in particular, and I served really well to finish,” said Federer, the 2009 champion in Paris, after hitting 47 winners.
“It shows me that I still have something in the tank, it’s super important for confidence.”
Former US Open winner Cilic was also handed a time warning late in the third set.
Playing in only his second French Open since 2015, Federer goes on to face Germany’s 59th-ranked Dominik Koepfer for a place in the last 16.
Federer has now reached the last 32 in Paris for a 16th year after making his debut in 1999.
However, he is playing only his third tournament of the year and first Slam since losing to Novak Djokovic in the Australian Open semi-finals in 2020.
In between, he underwent two knee surgeries.
Seeded eight this year, he is drawn to face Djokovic in the quarter-finals.