Farah, who had not lost a final in 2,176 days, having also won the 10,000m and 5,000m at the 2013 and 2015 World Championships, crossed the line in 13 minutes 33.22 seconds.
Paul Chelimo of the United States took bronze.
Andy Butchart then raced to the front alongside Farah briefly on the penultimate lap, as Yomif Kejelcha and Edris took over at the bell.
In a tactical race, Farah could not respond to a challenge for the first time in six years, turning his farewell race on the track at a major championship into a disappointment.
Farah, who had won the 10,000m last Friday to open the championships with a bang, said he couldn't have given it more but added he had proved that it was possible to break up the Ethiopian and Kenya hegemony over the distance races. They worked as a team.
Claiming to have been exhausted after his 10,000m efforts and 5,000m heats, he added: "Tactically, I was trying to cover every move". The better man won.
Admitting he had been outmanoeuvred, Farah said: "I got boxed in early on - it doesn't normally happen - but I got boxed in early and couldn't get out".
Australia's Sally Pearson celebrates winning the final of the women's 100m hurdles.
Farah embraced his family and then took a lap of honour to soak up the adulation of his home crowd, but as with his great friend and fellow legend Usain Bolt, he was denied the win he so desperately wanted in his last individual outing. That he finishes with silver on the track clearly wasn't the farewell he had planned.