Peake opened the race by counting down in a video message as runners waited at the start line in the British capital.
He then joined them 400 kilometres above earth on a simultaneous feat on board the space station, wearing weights on his body to counter the zero gravity conditions.
"Hello #London! Fancy a run?" Peake wrote on Twitter before the race, accompanied by a photograph of London from above.
He followed up with a message sent after he completed the marathon, in which he noted that while he had run the 42 kilometres the International Space Station had travelled almost 100,000 kilometres.
"Congratulations to everyone in #LondonMarathon & #teamastronaut," he wrote. "Gonna sleep well tonight!"
Peake is the second person to complete a marathon in space, after US astronaut Sunita Williams ran the Boston Marathon on the ISS in 2007 in a time of four hours, 23 minutes and 10 seconds.
But Peake managed to achieve the fastest ever marathon in space by making a time of three hours, 35 minutes and 21 seconds, according to estimated times posted on the website of the European Space Agency.
The Guinness World Records announced that it was a new record.
"Guinness World Records can confirm that ESA Astronaut Tim Peake has achieved a brand new Guinness World Records title for the Fastest marathon in orbit," the records body wrote on its website.
Peake had been helped by a training regime onboard the space station and an iPad showing a moving image of the run.
Back on earth in the British capital, more than 39,000 people completed the London Marathon, the biggest number ever as the event marked its 36th edition.
The men's race winner was Kenya's Eliud Kipchoge, who finished in two hours, three minutes and five seconds -- the second fastest time ever recorded.
The women's title was taken by fellow Kenyan Jemima Sumgong, who finished in two hours, 22 minutes and 58 seconds despite earlier hitting her head in a heavy fall.
Peake, 44, is the first Briton to travel to the International Space Station. He blasted off in December for a six-month mission that has generated considerable excitement in Britain.
"It was an unforgettable experience," he said of the marathon in a statement issued by the race organisers.