Bernard Lagat of the United States won the gold medal on Sunday in the final of the men's 5000m at the World Championships as Britain's Mo Fara claimed a brave sixth.
Lagat, 32, timed his run to perfection in the last 100m and held off Kenya's Eliud Kipchoge before crossing the line. Moses Kipsiro of Uganda took the bronze medal.
Kenya-born Lagat thus claimed his second gold of the games after earlier triumphing over 1500m, the first man in history to complete the double in the World Championships.
As the race began at a slow pace, Farah took up position at the back of the pack.
The UK champion then moved through the middle of the field as the pace quickened at the midway point and took up a position on the shoulders of Benjamin Limo of Kenya and Australia's Craig Mottram.
Farah remained in the top four as the lead constantly changed but with three laps remaining his hard work was nearly undone as he was clipped from behind before regaining his balance down the home straight.
He led alongside Kipsiro with 700m remaining and surged into the lead through the bell before fading down the back straight.
"I was surprised by the slow early pace and I thought it was playing into Lagat's hands," Farah said.
"I was aware that I was here in the World Championships final and I had felt good in the heat and came into the final feeling good.
"My training has gone really well and I have to thank Alan Storey, Mark Rowland and all the medical team for all the support they've given me.
"I was pleased with how last year went and I'm more pleased with how this year has gone and looking forward to next year.
"I feel I now have the confidence and experience to do even better."