British long-distance runner. AFP
The four-time Olympic gold medallist was due to run the race for the first time since 2019 after making a return to the track in a failed attempt to compete at last year's Olympics in Tokyo.
Farah did return to form on the road by winning the "Big Half" -- a London half marathon -- earlier this month.
"I've been training really hard over the past few months and I'd got myself back into good shape and was feeling pretty optimistic about being able to put in a good performance," said Farah in a statement issued by London marathon organisers on Wednesday.
"However, over the past 10 days I've been feeling pain and tightness in my right hip. I've had extensive physio and treatment and done everything I can to be on the start line but it hasn't improved enough to compete on Sunday."
He added: "It's really disappointing to have to withdraw after a good last few months and after my win at The Big Half but also because I love racing in front of my home crowd in London who always give all of us athletes such amazing support."
Farah has never won the London marathon in three previous attempts, with his best finish coming in 2018 when he was third.
Ethiopian reigning champion Sisay Lemma and his compatriot Kenenisa Bekele, the second-fastest marathon runner of all time, are among the favourites for the men's race.
Kenya's Eliud Kipchoge is not running after smashing his own world record by 30 seconds at the Berlin marathon last Sunday.
(For more sports news and updates, follow Ahram Online Sports on Twitter at @AO_Sports and on Facebook at AhramOnlineSports.)