A record number of runners finished the 39th London Marathon as organisers celebrated the most “extraordinary” race in the event’s history.

A total of 42,549 competitors had crossed the line by 7pm – over 2,000 more than last year – after British tennis champion Sir Andy Murray pushed the starting button on Sunday morning.

Kenyan ace Eliud Kipchoge set a course record of two hours, two minutes and 37 seconds, narrowly missing his own world record, as British Olympic hero Sir Mo Farah finished fifth, crossing the line in two hours, five minutes and 39 seconds.

Celebrity runners included an eight-strong team of EastEnders cast members who ran alongside Dame Barbara Windsor’s husband, Scott Mitchell, for the event’s charity of the year, Dementia Revolution.

The Duke of Sussex made a surprise appearance as he handed out medals to winners and greeted race volunteers. Harry’s attendance was initially in doubt as he awaits the birth of his first child with Meghan Markle.

Harry with the men's winner Eliud Kipchoge and women’s winner Brigid Kosgei
Harry with the men’s winner Eliud Kipchoge and women’s winner Brigid Kosgei (Paul Harding/PA)

Money raised for charity through the marathon since its conception in 1981 has now passed £1 billion, with organisers this year using the hashtag #ThanksaBillion to promote the race.

Event director Hugh Brasher said: “We have had many extraordinary days in the history of the London Marathon but today was even more than that. Thanks to the incredible efforts of a record number of runners, we have now raised more than £1,000,000,000 for good causes.”

Farah, 36, said after the race that he had “felt good” mid-way through the course, which started in Blackheath and ended at The Mall, but could not match “incredible” Kipchoge, 34.

He also insisted his widely publicised spat with Ethiopian Olympian Haile Gebrselassie did not affect his run.

“I didn’t think the fuss affected my run and I wasn’t distracted by the build-up, it was all about London today and so I put my head down, did my best,” he said.

There were dramatic scenes at the finish line for British elite woman Hayley Carruthers, 25, who collapsed to her knees inches from the finish line, before crawling over with a new personal best of two hours, 34 minutes and three seconds

Hayley Carruthers on the ground as she crosses the line
Hayley Carruthers on the ground as she crosses the line (Paul Harding/PA)

The EastEnders runners led by Mr Mitchell, who turned 56 on Sunday, had raised £130,000 by Sunday afternoon through their run for Dame Barbara, who was diagnosed with Alzheimer’s in 2014.

An emotional Mr Mitchell said after his finish in five hours, 41 minutes and 40 seconds: “Barbara, I love you, I’ve trained and run this marathon for you and the 850,000 people living with the condition.

“You were in my mind the whole time, otherwise why on earth would I be running this on my 56th birthday.”

Dementia Revolution is a partnership between the Alzheimer’s Society and Alzheimer’s Research UK.

Other stars to run for the charity included radio presenter Chris Evans, 53, who said his fifth marathon was “fantastic”.

Sir Richard Branson, founder of the Virgin Group, said it was an “amazing marathon” as he hinted he might run next year.

“It’s been beautifully organised and it’s so amazing to have raised the big £1 billion,” he said.

Guinness World Records announced 38 world records were achieved at the race, including the fastest marathon dressed as an awareness ribbon and fastest dressed as a zombie.

Others who celebrated included Eileen Noble, 84, the oldest female competitor who crossed the line in six hours, 28 minutes and seven seconds.

“I don’t feel too bad now but I must keep moving, it’s getting harder every year as I get older,” she said as she pledged to run again next year.

The race had been a doubt for charity runner Richard Inkpin, 30, from Braintree, Essex, whose second child with wife Charlotte was due on Sunday.

But he was able to run with a time of four hours, 35 minutes and 57 seconds after baby Olive was born a day early, at 6.11am on Saturday.

So-called “ever present” runners – those who have completed every London Marathon – included Chris Finill, who finished in two hours, 59 minutes and 46 seconds.

“No matter how many times I run this race, there’s always something new about it,” said the 60-year-old, who finished last year despite breaking his arm just three and a half miles into the course.