You are not permitted to download, save or email this image. Visit image gallery to purchase the image.
The Swiss great, contesting his eighth final at the All England Club, flirted with danger in the second set after losing the first but just when Murray looked like ending 76 years of plucky British failure Federer gave a stunning reminder of his genius to win 4-6 7-5 6-3 6-4 on Centre Court.
When a Murray forehand looped narrowly wide after three hours 24 minutes of enthralling action, Federer dropped to the turf in joy, just as he did in 2003 when he beat Australia's Mark Philippoussis to begin a grand slam collection that now stands at 17.
For the second time in three grand slam finals against Murray he reduced the Scot to tears, although this match, unlike the others, was a contest to savour.
It was only after Centre Court's translucent lid was slid across after heavy rain began to fall in the heart of the final that Federer took charge, striding to the win that puts him level with Pete Sampras's record of seven Wimbledon crowns.
At 30 years and 335 days he also became the oldest men's champion since Arthur Ashe in 1975 and, to put the icing on the cake, Monday's ATP rankings will show him back at No. 1 for the first time in two years and he will equal Sampras's record of 286 weeks at the summit.
"I played some of my best tennis in the last couple of matches," Federer said after raising the trophy with his wife Mirka and giggling twin daughters Charlene Riva and Myla Rose watching on from the players' box.
"I've missed playing in the finals, and it feels like a great moment. I've gone through some struggles, so this one comes at the right time," added Federer, whose last grand slam title was at the 2010 Australian Open.
For Murray, his girlfriend Kim Sears and many of the thousands watching the huge screen on Henman Hill under a forest of multi-coloured umbrellas, there was just despair.
"I'm getting closer," Murray, whose valiant effort was watched by Royal Box guests Prime Minister David Cameron, David Beckham and Prince William's wife Kate Middleton, choked as applause rang out.
"I was told after my semi-final that this was my best chance, Roger's 30 now, but he's not bad for a 30-year-old, he played a great tournament. Congratulations, you deserve it."
While Federer basked in the glow of another major title, Murray was left to contemplate equalling coach Ivan Lendl's unwanted record of losing his first four grand slam finals.
A gracious Federer had words of encouragement.
"I think he's giving himself so many looks at big titles. I really do believe deep down in me he will win grand slams, not just one," Federer told reporters.
By defeating Jo-Wilfried Tsonga on Friday, Murray had become the first British man to reach the final since Bunny Austin in 1938 and as the players set foot on a sunlit Centre Court, there was an electric buzz of anticipation that he would emulate the 1936 title of Fred Perry.
Having failed to win a set in two Australian Open finals and one U.S. Open one, Murray would have been excused early match nerves but he came out firing to break Federer in the opening game of the match.
Federer quickly restored parity and wasted break points when leading 4-3 as Murray's first serve misfired.
The Swiss was made to pay in the following game, sloppily dropping serve and Murray closed out the opening set with ease to a deafening roar from the 15,000 crowd.
Murray was the more threatening player in the second and upped the ante at 4-4 only to squander two break points that would have given him the chance to serve for a two-set lead and leave Federer facing a daunting task.
"The second set I had some chances and didn't quite get them," Murray said. "Often what happens is matches change over a couple of points here and there."
That was the case as Federer seized his chance. A tiebreak loomed but, out of nowhere, Federer conjured a set point with an exquisite drop shot and grabbed it with another stunning volley after a mesmerising rally.
The crowd sighed and then the rain began to fall, a prelude to the British tears that were to flow later.
After a 40-minute break while the roof was rolled into position, the players returned, only this time Federer looked a different player - dominating rallies with a dazzling mixture of power, spin and clever angles.
Had Murray survived a marathon service game at 2-3 in the third, things may have been different, but when Federer struck on his sixth break point it proved to be the beginning of the end for the fourth seed who took several tumbles.
Federer hammered another nail in the coffin with a backhand winner to break midway through the fourth set and despite chants of "Murray...Murray" echoing around the court, kept his cool to close out the match on his second match point.
"It was crazy how it all happened under the circumstances," said Federer, of the first Wimbledon singles final to be partly played under the roof.
"I'm happy that closing the roof maybe helped me today."