British astronaut Tim Peake has completed the London Marathon — from 400 kilometres above the Earth.

Peake ran the 42 kilometre race harnessed to a treadmill aboard the International Space Station, with a simulation of the route through London's streets playing on an iPad.

He finished in three hours and 35 minutes. Guinness World Records says that's a record for the fastest marathon in orbit.

American astronaut Sunita Williams ran the Boston Marathon from space in 2007 in four hours and 24 minutes.

British astronaut Tim Peake seen on footage running the London Marathon in the ISS. Photo: ABC