The 32-year-old Olympic champion, who won the 10,000m in Beijing last weekend, clocked 13 minutes 50.
38 seconds to win a record third straight 5,000 metres world title.
It was Farah’s seventh successive major distance crown after he won the 5,000m at the 2011 world championships and the double at the 2012 London Olympics and the 2013 world championships in Moscow.
“It is great to make history,” Farah told the BBC. “I didn’t feel great, my hammy was playing up a bit but the medical team helped me through it and tonight come out here and make a double means so much to me.
“I was kinda getting nervous for the first time in a little while but thanks to all the medical team. It was amazing to do it.
“Hopefully, the younger kids watching me will be encouraged. I want to be able to do something for them.”
Caleb Ndiku, who kicked with two laps to go to try to mitigate the impact of Farah’s strong finish, won silver for Kenya in 13.51.75 with Hagos Gebrhiwet, second behind Farah in Moscow two years ago, taking bronze for Ethiopia in 13.51.86.
Gebrhiwet’s team mate Yomif Kejelcha finished fourth and Farah’s training partner Galen Rupp was a distant fifth.
Farah’s achievement was all the more impressive because his preparations for Beijing were disrupted by allegations of doping levelled at he and Rupp’s coach Alberto Salazar.
There has been no suggestion that Farah has done anything wrong while Salazar has vehemently denied the allegations.
A further deviation Farah’s usual championship experience was that his wife, who is expecting their fourth child, and family did not travel to Beijing.
“It would have been nice to see my wife and my kids here tonight but unfortunately they weren’t here, but watching at home,” Farah added.
“Sometimes, as a parent, you don’t want to be away so much. It hurts sometimes. I am so looking forward to spending time with my family. I just want to go home and celebrate with them.”
On another muggy night at the Bird’s Nest Stadium, the early pace was slow with Farah at the back and his compatriot Tom Farrell taking the lead.
With six laps to go, Farah eased up to the front and again took a few bumps in the leading pack as he had in the 10,000 metres final and 5,000 metres heats.
Ndiku sped off at the start of the penultimate lap and led for the next 700 metres but Farah stayed with him, closing the gap on the Kenyan before hitting the front after the final bend and crossing the line, arms raised, 10 metres clear.
“I’m very, very happy tonight,” said 22-year-old former world junior champion Ndiku.
“This is my first world championships for senior category.”
(Editing by Ed Osmond)