It was the first major sporting event in the Chinese capital since the Winter Olympics in February.
China continues to adhere to a strict zero-Covid policy, with harsh lockdowns, quarantines and testing regimens imposed after even the smallest outbreaks.
As a result, only people living in Beijing were allowed to take part in the race, unlike previous editions, which had attracted foreign runners.
Some runners kept their face masks on for the race, which Anubaike Kuwan from Xinjiang won in two hours, 14 minutes and 34 seconds.
The marathon was meant to resume last year but was cancelled again to avoid any outbreaks of Covid ahead of the Beijing Olympics.
On Sunday, runners went past Tiananmen Square as they completed the race through the streets and highways of the Chinese capital.
The mood appeared festive, with some participants wearing colourful wigs, carrying flags or high-fiving youngsters on the sidelines.
China's zero-Covid policy has seen it sharply cut links to the rest of the world since 2020 in a bid to limit outbreaks caused by travellers.
The policy has also disrupted the country's ambitions to host major sporting events, with Formula 1 grands prix, golf and tennis all cancelled in recent years.
In recent days China has recorded its highest number of positive cases of the virus since May.
(For more sports news and updates, follow Ahram Online Sports on Twitter at @AO_Sports and on Facebook at AhramOnlineSports.)