There was relief for American sprinter Tyson Gay after he safely negotiated his first competitive 200 metres for two years and compatriot Carmelita Jeter beat Jamaica's Olympic 100 champion Shelly-Ann Fraser-Pryce for the second time in four days.
Britain's Farah, whose wife gave birth to twin girls on Friday, had to produce his trademark turn of speed on the final lap of the distance race when Italian Daniele Meucci suddenly attacked on the outside.
With a wicker replica of Farah in his celebratory 'Mobot' pose overlooking the track, the London Games 10,000 and 5,000 metres champion kicked and pulled away from the field on the home straight, sending the stadium wild, to win in eight minutes 27.24 seconds. Meucci was second in 8:28.28.
"I love competing on British soil, it's what it is all about, getting the support from everyone and I just appreciate everyone being with me all the way," Farah told reporters.
"It hasn't been the easiest week because my wife gave birth to two little girls, so it hasn't been easy coming here and getting this out the way.
"What a year I've had, it will never happen again like this - two twins, two gold medals," added Farah who has said he will give one to each girl.
Former world champion Gay started well in the 200 but tightened up down the home straight and finished behind Jamaica's Nickel Ashmeade, who won in 20.12.
"It was pretty good, interesting," Gay, second in 20.21, told the BBC.
"It was my first race in two years and it feels good to finish," added the Olympic 4x100m silver medallist, who had concentrated on the short sprint in recent seasons after suffering a series of injuries.
Racing next to her great rival, Jeter eased ahead of Fraser-Pryce early on in the 100 metres and never looked like being caught as she won in a meeting record of 10.81.
Twice Olympic champion Fraser-Pryce, wearing a black and yellow ribbon in her plaited hair, was second (10.90) as she had been in Lausanne on Thursday.
There were no nervous twitches from Aries Merritt in the 110 hurdles as the Olympic gold medallist, who was disqualified for a false start in Lausanne, held off world champion Jason Richardson for victory in 12.95.
Olympic high jump champion Ivan Ukhov suffered a second successive Diamond League defeat when he finished behind London bronze medallist Robert Grabarz of Britain, who cleared 2.32.
There was also disappointment for Britain's long jump gold medallist Greg Rutherford who had treatment for a groin problem during the competition on Sunday and could manage only third behind Russian Aleksandr Menkov (8.18)
- Daniele Meucci
- Tyson Gay
- Carmelita Jeter