Under the new agreement, the BBC will continue as the exclusive UK broadcaster of the London Marathon on TV, radio, the internet, mobile and BBC iPlayer.
The marathon has aired on the BBC since it started on 1981, and despite recently losing other sporting events, the corporation has ensured that it retains the rights to the sporting celebration.
The deal also comes ahead of live coverage of the 2012 Virgin London Marathon, which starts at 8.30am on April 22 on BBC television, Radio 5 Live and online.
BBC director sport Barbara Slater, who has had to cope with a 15% cut in the corporation's budget for sports rights under an efficiency drive, said that the marathon is a "key part of BBC Sport's calendar".
"We're delighted to continue our longstanding partnership with the London Marathon," she said.
"This prestigious race is a hugely important national event and a key part of BBC Sport's calendar. We look forward to bringing the full spectacle live to audiences through to 2018 across the BBC platforms."
Virgin London Marathon joint race director David Bedford added: "The BBC has been a vital partner of the London Marathon since it started in 1981 and its unrivalled coverage is a key ingredient of the event's success and popularity, not only in Britain but across the world.
"We are delighted with this new agreement which ensures the event will continue to enjoy the profile it deserves over the coming years."
Sue Barker will present the TV coverage of the London Marathon this Sunday on BBC One and BBC One HD, backed up by reporting from Jonathan Edwards, Colin Jackson, Denise Lewis, Phil Jones and Sonali Shah.
Digital TV viewers will be able to use the Red Button to select which parts of the race they want to watch, along with choose from a range commentaries. A highlights programme will be aired on BBC Two at 5pm and offered on BBC iPlayer.
> BBC secures Challenge Cup TV rights up to 2016