The distance runner became the first British track and field athlete to win three Olympic golds as he came home in a time of 27:05.18.
Farah was given an early scare when he was tripped by training partner Galen Rupp but he recovered quickly to make up ground on his rivals.
Paul Tanui of Kenya took silver with Ethiopia’s Tamirat Tola in bronze.
Farah said: “It was really emotional. Some things you can’t control in a race so when I went down it didn’t take a lot out of me and I managed to get up quickly.
“I just thought about how much I’d worked for this race and I wasn’t going to let that go.
“Mentally when you go down you get really emotional but I had to pick myself up and believe in myself and work through.
Farah had decided to sit at the back of the field at the start of the race before surging through to the front.
He was tripped by Rupp with 16 laps remaining but there was no lasting damage to the 33-year-old.
With three laps remaining, Farah was part of a group of seven challenging for the win but that was wittled down but he was still under pressue on the final lap.
Tanui made his move for home with 300m remaining but Farah reeled him in and surged past him on the final bend to lead the field home.