In claiming his 17th Grand Slam title, the Swiss player equals American Peter Sampras’s record of seven titles at the grass court tournament.
A tearful Murray was the first British player to reach the final of the London event since Bunny Austin lost to Don Budge in the 1938 final. He was attempting to become the first British winner of the event since Fred Perry managed it wearing slacks two years earlier.
Murray said: "I'm getting closer. The support has been incredible so thank you. I'd like to congratulate Roger. He is such a great champion. Was this my best chance? Roger is 30 now. He showed what fight he still has left in him after having back problems earlier in the tournament."
Federer said: "I think he (Andy) will at least win one Grand Slam. This is what I hope for Andy. I think I played some of my best tennis in the last couple of matches. I couldn't be more happy being back here as the winner. It is a great moment. It feels nice to get my hands back on the trophy."
Federer returns to the world number one spot courtesy of his win and will overtake Sampras’s career total of 286 weeks at the summit of the game. He becomes the first man in his 30s to win a Grand Slam since Andre Agassi collected the Australian Open in 2003.
"This just feels amazing," added Federer. "I never stopped believing. I have great momentum, great confidence and it all came together for me. It is a magical moment for me."
Federer, 30, had held the world number one spot for 285 weeks, but has not been ranked number one since May 2010.
He was made to work for his win over Murray having been broken by the gallant Scotsman in the ninth game of the match to drop the opening set before predictably coming roaring back to claim the next three sets with some of his finest tennis.
Murray produced an almighty performance and could easily have won the second set before rain forced the final to be moved under the roof on Centre Court. It changed the whole context of the match with no wind to divert Federer's ball striking skills.
It certainly seemed to suit Federer, who subjected his opponent to considerable pressure with a sense of the inevitable shrouding the home man's serve as Murray was broken twice at key moments in the third and fourth sets.
Watched by British Prime Minister David Cameron, Scottish First Minister Alex Salmond, the Duchess of Cambridge - and the Beckhams - the final was a match that saw Murray perform stoutly in winning his first set at a Grand Slam final after two defeats in straight sets in Australia and one at the US Open, but he will be left to consider what might have been. He could easily have been two sets to the good before Federer spoiled the Great British party.
The man from Dunblane in Perthshire made an exhilarating start to the day by benefiting from a slipshod Federer service game to break in the opening game of the match.
A backhand error by Murray enabled Federer to level at 2-2 before Murray produced a delicate winning volley to save the second of two break points in the eighth game.
A drilled forehand at the body of Federer helped bring up a break point for Murray before the Swiss player netted a forehand to drop serve for a second time.
Murray saw out the set comfortably on serve, but there was always a gnawing sensation that Federer would come to life such is his pedigree in the sport. With Rafael Nadal the only man to have beaten him in a Wimbledon final in five epic sets four years ago, Federer is not a character who tends to slip quietly into the night.
Murray resisted Federer to stave off a break point in the second game of the second set, but he could not ram home the escape as four break points came and went in the four and eighth games of the second set. They would prove to be key misses.
There was no such profligacy from Federer, who recovered from 30-0 behind on Murray’s serve before converting a winning volley of real quality to convert set point into a second set that seemed destined for a tie-break.
The groans from the 15,000 onlookers inside Centre Court and the millions of British supporters watching on television were almost palpable.
The mood of the match was changing and the tone of proceedings did not help Murray when the match became an indoor contest as the rain tumbled down with Federer leading 40-0 and serving at 1-1 in the third set.
Having emptied last year's winner Novak Djokovic out of the tournament in the semi-finals under the roof on Friday, Federer's credentials in such conditions were never really up for debate.
Murray had not beaten Federer indoors for almost five years and when play resumed some 35 minutes later, Federer seemed to have a foot on Murray’s neck. He never really released it.
Murray constructed a 40-0 lead, but was slowly sucked in by the finesse and intelligence of Federer’s play as he was finally broken on the sixth break point of a sixth game lasting almost 19 minutes with Murray’s slips at the net an emblem of the way the match was unravelling.
Federer looked to press Murray's second serve with his ferocious forehand and would proceed to snare the third set 6-3 for a 2-1 advantage before he plunged the dagger into the Scot’s service game for a final time when he broke in the fifth game of the fourth set as he swarmed all over Murray’s second service like a rash.
It became clear Murray was about to join Mark Philippoussis, Andy Roddick (three times) and Rafael Nadal (twice) as Federer's victims in the third Grand Slam final of the season.
Federer tumbled to the ground to celebrate his first win in a Grand Slam final since he downed Murray in straight sets at the 2010 Australian Open in scenes not far removed from his first success at Wimbledon in 2003. It was his third win over Murray in a Grand Slam final.
Murray was not outclassed, but did fall down in two crucial elements. He fell short of averaging more than 7.2 points per game on service return while his first service percentage was only 56 percent providing Federer with ample scope to exploit the second serve.
In saying that, if the British weather had been as kind to Murray as the British crowd, perhaps the home player would have wound up standing with the winner's trophy.