Fresh from his victory in the 10,000m final, where he also overcame a stumble on the last-lap, Farah just managed to stay on his feet after being clipped by another runner.
The Briton nearly tumbled over but recovered to qualify second fastest overall, just behind Ethiopia’s junior world champion Yomif Kejelcha.
The 18-year-old Kejelcha crossed the line first in 13 minutes 19.38 seconds, with a relieved Farah just 0.06 in arrears.
“I tripped, somebody nearly took me down, just caught my leg,” Farah said in a trackside interview at the Bird’s Nest stadium.
“It happens, I have such a long stride, so often people catch my leg.”
Farah, 32, won the 5,000m at the last two world championships and is bidding to become the first man to win the event three times.
He is also striving to repeat his 5,000m-10,000m double from the last world championships and the 2012 London Olympics but is taking nothing for granted.
“That was good to get the heats out of the way, it was nerve-wracking,” Farah said.
“Sometimes you’re expected to get to the final but it doesn’t quite happen so it’s important that you take care of the rounds and get ready for the final.”
Kenya’s Eunice Sum, the defending champion in the women’s 800m, easily won her heat to advance to the semi-finals of the two-lap event.
Sum won her heat in 1:59.67, the fifth best time overall, with Maryna Arzamasova of Belarus topping the qualifying in 1:58.69, just ahead of Britain’s Lynsey Sharp and South Africa’s Caster Semenya, the 2009 world champion.
American David Oliver, another defending world champion, set the quickest time in the heats of the men’s 110m hurdles, stopping the clock at 13.15.
He was just 0.10 ahead of his countryman Aries Merritt, the 2012 Olympic champion and world record holder.
In the men’s triple jump, Cuba’s Pedro Pablo Pichardo qualified first ahead of American Christian Taylor, the reigning Olympic champion.
Pichardo won the silver medal at the last world championships and topped the qualifiers with a leap of 17.43m, with Taylor second overall with 17.28.
Poland’s Anita Wlodarczyk, one of the biggest favourites to win gold in Beijing, topped the qualifiers for the women’s hammer throw.
Less than four weeks after breaking her own world record, Wlodarczyk easily qualified for the final with a throw of 75.01m, well inside her best, as she looks to regain the world title she won in 2009.
(Writing by Julian Linden in Singapore; Editing by John O’Brien)