Runners from more than 100 countries set off from the centre of a rain-soaked Edinburgh to take on the 26.2-mile course. Organisers said around 30,000 people had signed up for the weekend festival, which also included a half-marathon, relay event, 10k and 5k routes.
Kenya's David Toniok, 30, raced to the finish line first to win the marathon in 2 hours, 15 minutes and 33 seconds, only 7 seconds off the course record.
Kateryna Stetsenko, 32, from Ukraine, was the fastest female finisher, crossing the finish line in Musselburgh in 2 hours, 36 minutes and 7 seconds.
The half-marathon was won by Scottish runner Ross Houston, who finished in 1 hour, 7 minutes and 16 seconds.