His victory makes him the first British man to win the Olympic singles gold medal since Josiah Ritchie in 1908.
Murray defeated Federer in three straight sets, winning 6-2 in the first set, 6-1 in the second set and 6-4 in the third and final set.
"It's number one for me - the biggest win of my life," he told the BBC after his win.
Federer had previously beaten Murray at the Wimbledon final just 28 days ago.
The tennis player, who will later face Belarusians Victoria Azarenka and Max Mirnyi with partner Laura Robson in the mixed doubles, has been congratulated by fellow sports stars, politicians and celebrities:
David Cameron: "So proud of @Andy_Murray becoming Olympic Champion after @Wimbledon disappointment. Let's hope he can make it double gold later."
Boris Johnson: "He's only gone and done it! @andy_murray is champion on the lawns of Wimbledon in straight sets. Good luck for the Mixed final!"
Lord Sugar: "Yes gold brilliant well done Andy Murray."
Piers Morgan: "BOOOOOM!!!! Fantastic! Gold for Murray. #TeamGB."
Amir Khan: "Well done to Andy Murray in the tennis. Awesome play by him. He's taking the the gold and become Olympic champion beating Roger Federer."
Chris Hoy: "Never in doubt @andy_murray Bravo!!"
Olly Murs: "WELL DONE @andy_murray GOLD MEDAL winner!! Simply awesome!! So deserves it... Well happy for him!! Grand slam next!!"
Holly Valance: "LOVE AN ACE FINISH!! So proud! Well done #AndyMurray!!!!!!!!!! Just brilliant!!!!!"
Rochelle Humes: "Well done to Andy Murray!! :) Bet the atmosphere in Wimbledon is electric! Well deserved! #TeamGB."
Georgie Thompson: "You absolutely deserved that @andy_murray. Inspired, brilliant and best of all British!"
Simon Pegg: "Andy Murray wins #GOLD!!!!! Oh good god could this nation's pride gland swell to a greater tumescence than that with which it throbs now?!!!"
Amanda Holden: "Andy Murray! We salute you!!! Amazing! X"
Carol McGiffin: "Well well well! Come on Andy!!!"
Dwyane Wade: "Congrats to a well deserved champion @andy_murray.. #GOLDMEDAL #HeatFamily."
Eddie Izzard: "ANDY MURRAY HAS WON THE GOLD MEDAL!!!"
Photo gallery: London 2012 Olympics:
Copyright: Martin Rickett/PA Wire/Press Association Images