The 38-year-old Farah, who won a grand double, clinching the 5,000m and 10,000m gold at the 2012 London and 2016 Rio Olympics, clocked 27:50:54 which was his slowest since 2014 and good enough for eighth place.
Farah was expected to have an easy outing on Saturday given that he was competing in the 10,000m after nearly four years, but he started struggling midway, which he attributed to a niggle to his left ankle sustained 10 days ago.
This was Farah's maiden loss over the distance in nearly a decade, since emerging second at the World Championships in Daegu in 2011.
"I am obviously disappointed with the result but it is what it is. Without making any excuses, the last 10 days haven't been great as I've been carrying a niggle since I got back from training," Farah told The Guardian.
"With 15 laps to go you know my face but I was hurting hard. I just had to keep fighting, keep digging. Keep digging in and finish within the top two. I honestly thought with five laps to go, I had the time."