A day after Rafael Nadal crashed out, Federer recovered from two sets down to win 4-6 6-7 (3-7) 6-2 7-6 (8-6) 6-1.
Federer struggled against the power of the 29th seed in the first two sets.
But having clawed his way back to parity, Federer took advantage of an injury to his French opponent to sweep through the final set in 26 minutes.
Third seed Federer plays Belgian Xavier Malisse on Monday for a place in the quarter-finals.
Federer, 30, went into the match a red-hot favourite having dropped only nine games in his first two matches.
But Nadal's loss to world number 100 Lukas Rosol, arguably the biggest upset in Wimbledon history, showed that no player is safe on the grass of SW19.
Benneteau, also 30, reached the fourth round of Wimbledon in 2010 but has never won an ATP Tour event.
However, he beat Federer the last time they met, on the hard courts of Paris in 2009, and the underdog came out swinging under the Centre Court roof.
Behind a booming serve and thunderous groundstrokes, Benneteau ambushed Federer in the first set, breaking him at 4-4 before holding serve.
The players exchanged breaks at the start of the second set and when Benneteau won the tie-break 7-3, Federer was contemplating his first third-round exit at a Grand Slam tournament since the French Open of 2004.
But Federer made short work of the third set before coming through a nerve-jangling fourth-set tie-break.
With a raucous crowd contemplating an epic deciding set, disaster struck for Benneteau when he succumbed to an injury in his first service game.
Benneteau received a vigorous massage but could not be fully revived, allowing Federer to sweep into the last 16 for the eighth year in a row.