The Briton avenged his Wimbledon final loss to the world No 1 as he charged to a 6-2, 6-1, 6-4 victory.
Of his success, Murray said: "I watched the athletics last night it was amazing.
"The way Mo Farah won the 10,000m ... I do 400m repetitions in my training and when I'm completely fresh I can run it in 57 seconds and his last lap after 9,600m was 53 seconds. It's just unbelievable fitness.
"It gave me a boost coming into today. The momentum the team's had the last couple of days has been so good.
"It is the biggest win of my life. This week's been incredible so far. I've had a lot of fun, the support's been amazing … it's been unbelievable."
Murray was always in charge of the final, breaking twice in both the opening two sets, before breaking in the sixth game of the third set and he sealed the win with an ace.
Of his performance, he said: "I felt so fresh. On the court today I didn't really feel nervous at all apart from at the beginning of the match.
"I've had a lot of tough losses in my career. This is the best way to come back. I'll never forget it."
Federer, who had been hoping to win Olympic gold for the first time in his career, said: "I didn't think I played too bad in the final but things didn't go my way and Andy was confident.
"He played well, good shot-making decisions and I didn't do that so well today."
Juan Martín del Potro had earlier secured the bronze medal, beating Novak Djokovic in straight sets 7-5, 6-4.
Murray missed out on the chance of picking up two gold medals on the same day as he and partner Laura Robson lost the mixed doubles final to the Belarus duo Victoria Azarenka and Max Mirnyi 1-6, 6-3, 10-8.
Elsewhere, Serena Williams followed up her singles gold medal on Saturday by retaining the women's doubles gold with her sister Venus yesterday as they won 6-4, 6-4 against the Czech Republic duo Andrea Hlavackova and Lucie Hradecka to become the first tennis players to win four golds each.
The American sisters, who also won the doubles gold medals in Beijing and Sydney, took an hour and a half to win.
"There's something about standing next to Venus and holding that gold medal. Three times we have played, three times we have got the gold medal. So we are pretty stoked about it," said Serena.
Venus said: "It's incredible. After coming off Serena's victory I think most of all we are happy to add to our country's medal count and be a part of it."
She added they were planning to defend their titles at the next Games in Brazil in four years.
"We're definitely planning on Rio," she said. "We're going out with a bang in Rio. Hopefully we will make it four."
Follow us @SprtNationalUAE