The 17-times grand slam champion shook off back problems during the weekend and recovered from Friday’s defeat by Gael Monfils to hand France a third defeat in their last three finals.
With Federer imperious on serve, there was a sense of inevitability in the air at the Pierre Mauroy stadium despite the support of a record 27,448 raucous crowd and Gasquet’s decent level of play.
He made more unforced errors than the gifted Frenchman — 24 to 21 — but hit an astonishing 62 winners, kneeling down before lying on his chest after wrapping up the match with a cunning drop shot.
“We fought hard for it. I’ve been playing this game for almost 15 years and clearly I had never come as close than this past weekend,” said world number two Federer, for whom the only major title missing from his collection is now an Olympic singles gold medal.
“I’m happy I stayed calm and played a good match when I had to. I’m really happy for all the guys in the team.”
Gasquet said he was “very disappointed” to lose in straight sets.
“It’s the first time Roger plays at this level against me,” he said.
French captain Arnaud Clement had no complaints about the result.
“Right now I think we did everything right, me and the players. But Switzerland were better than us,” he said.
Federer dropped only four points on serve in the opening set, which he sealed with a whipping forehand winner after breaking Gasquet, the world number 26, in the third game.
Varying his shots to devastating effect, Federer toyed with his opponent, who dropped serve in the first and seventh games as the Swiss bagged the second set with a drop shot having not conceded a single break point.
Gasquet, sent to the clay court by captain Arnaud Clement in place of Jo-Wilfried Tsonga, who sustained an arm injury on Friday, looked slightly better at the beginning of the third set as Federer became careless.
But the Swiss, who withdrew from last Sunday’s ATP World Tour final with a back injury, was still the sharper player and broke on his first opportunity in the fifth game when Gasquet sent a backhand wide.
Stan Wawrinka gave them the first point by beating Tsonga in the first singles rubber before Monfils leveled on Friday.
Switzerland were 2-1 up going into Sunday’s reverse singles after Wawrinka and Federer teamed up to beat Gasquet and Julien Benneteau in the doubles on Saturday.
The fifth match between Wawrinka and Monfils was canceled.