Federer romped to a 6-4, 6-2, 6-2 win to hand the Swiss an unbeatable 3-1 lead after Stan Wawrinka had won the opening singles of the match and the world number two and four had teamed up to win the doubles on Saturday.
It was one of the greatest sporting triumphs for Switzerland, the 14th nation to win the Davis Cup, and a huge personal milestone for Federer to go with his 17 Grand Slam titles, six Masters titles and Olympic doubles gold.
It left him with just an Olympic singles gold to win in Rio in 2016 to become just the third man, after great rival Rafael Nadal and Andre Agassi, to win all four Grand Slam titles, the Olympic title and the Davis Cup.
"It's an an enormous pleasure for me, I've waited 15 years for this," Federer said.
"This has been a perfect weekend in a crazy atmosphere and all the Swiss fans helped us enormously.
But he refused to accept that finally winning the Davis Cup made him the greatest player of all-time.
"That's of no importance to me, what matters is that I enjoy playing tennis," he added.
Federer had expected to play Jo-Wilfried Tsonga in the first of Sunday's two rubbers, but the French number one, who lost to Wawrinka in four sets on Friday, was struggling with an arm injury and generally out of sorts.
In came Gasquet with the monumental task of defeating Federer and opening the door for the possibility of the in-form Gael Monfils defeating Wawrinka in the decider.
Another world record crowd of 27,488 roared their support for Gasquet as the two players came out into the red clay court set down inside one half of a roofed over Lille football stadium.
Gasquet fails to make inroads
The 33-year-old Swiss superstar executed an exquisite half-volley to bring up break point in the third game and sealed that with a superb backhand down
Gasquet could make no inroads at all on the Federer serve and he was struggling manfully each time to hold his own.
Federer failed to convert two set points at 5-4 up, but another love service game did the trick in the following game.
When Federer broke serve to open the second set, the heads visibly went down in the French camp, while the outnumbered Swiss supporters got to their feet.
The merest point earned by Gasquet on the Federer serve brought an ear-splitting reaction from the French fans and the occasional rendition of 'La Marseillaise'.
But it was all to no avail as a calm-as-you-like Federer brought up three more break points and converted the second of those to pocket the second set.
Gasquet put up some desperate late fight at the start of the second set, garnering a few points on the Federer serve, but he failed to earn a single break point.
The pressure on his own serve was all the more acute and a tired-looking backhand, which sailed well wide, handed Federer the final break of serve he needed.
Two games later it was all over, Federer falling to his knees in celebration after a final perfect backhand drop shot. He then shed some tears as he savoured a hugely emotional win
The French team looked miserable on the closing ceremony podiums as they watched Federer get his hands on the Davis Cup for the first time after years of trying.
"(Federer) was exceptional in every aspect of his play," French captain Arnaud Clément said.
"Richard (Gasquet) tried to be aggressive but Roger was just stunning.
"It's hard for us to take but on the day we have to say that the Swiss were the better team."
Swiss team hoist Davis Cup trophy. Photo: Philippe Huguen/AFP
FACT FILE ON ROGER FEDERER
World ranking: 2
Born: Aug 8, 1981
Birthplace: Basel, Switzerland
Residence: Bottmingen, Switzerland
Height: 185 cm
Weight: 85 kg
Turned pro: 1998
Coach: Severin Luthi and Stefan Edberg
Career singles titles: 82
Year-end championships: 6
Masters Series titles: 23
Grand Slam singles titles: 17 (Australian Open 2004, 2006, 2007, 2010, French Open 2009, Wimbledon 2003, 2004, 2005, 2006, 2007, 2009, 2012, US Open 2004, 2005, 2006, 2007, 2008)
Olympics Gold: Doubles (with Stan Wawrinka) 2008
Davis Cup: Winner 2014
World No. 1 - 302 weeks (Open-era record)