Mo Farah finished seventh in 30 minutes and 41 seconds in the Port-Gentil 10km in Gabon, 15 days before the London Marathon.
Four-time Olympic champion Farah, 40, has been training in Ethiopia in preparation for the marathon on 23 April.
He announced in January that he expects 2023 to be his final year of racing before retirement.
Kenya’s Vincent Kipkemoi won in Gabon in 28 minutes and 11 seconds.
Farah missed the 2022 London Marathon with a hip injury and this year’s event will be his first full marathon since 2019.
It is expected to be the Briton’s final London Marathon appearance and he will be up against four of the five fastest marathon runners in history, including Kenya’s Kenenisa Bekele.
The 2023 London Marathon will be broadcast live on BBC TV, iPlayer and online.