Federer has now drawn level with former American great Pete Sampras and William Renshaw with seven trophies at the All England Club.
It also ended the Swiss great's title drought for more than a year. His last Grand Slam was the Australian Open in 2010. The 30-year-old Grand Slam tally is now 17, a world record.
Home fans were expecting to welcome Murray as the champion after he had given them hopes by becoming the first man in 74 years to reach the Wimbledon final. Bunny Austin was the last Briton in the championship match in 1938. The last Briton to win the title here was Fred Perry in 1936.
It was a double joy for Federer as he also regained the world number one ranking.
"It equals me with Pete Sampras, who's my hero, so it feels amazing. It feels great being back here as the winner. It feels like it's never left me. I think I played some of my best tennis in the last couple of matches. I couldn't be more happy," said Federer in his post-match comments on the court.
Murray could not hold back his tears as he spoke after the loss. "I'm getting closer," said the 25-year-old.
"I'm going to try this but it won't be easy. Firstly I'd like to congratulate Roger. I was asked the other day if this is my best chance? Roger's 30. He's not bad for a 30-year-old."
"I can't look at you guys (in the box) or I'll start crying again... we did a great job so thank you."
The final was witnessed by British Prime Minister David Cameron, David Beckham, Australian tennis great Rod Laver, Manchester United coach Sir Alex Feguson among others.
A strong crowd behind him, Murray started off well, taking the first set 6-4. However, Federer bounced back quickly to draw level in the second with a 7-5 verdict.
Early in the third, rain arrived at 1-1 (40-0 for Federer) and the roof was closed to resume play after a 40-minute break.
From then on Federer grew stronger and completed the title triumph in four sets. Federer had previously defeated Murray in two finals, 2008 US Open and 2010 Australian Open.