The corporation said the deal would extend across all platforms, including TV and radio, mobile and full broadband coverage through the BBC Sport website.
The deal will mark the first time the broadcaster has screened full race coverage on TV since 1996, although BBC Radio 5 Live does provide full commentary for all F1 races.
In a statement, ITV said it had been a "straightforward commercial decision for ITV" to exit F1 at the end of the year, and that it was "pleased" the sport would continue to be broadcast free-to-air.
Securing the rights for F1 is a major coup for BBC Sport, which lost out to BSkyB earlier this week to broadcast the majority of Champions League coverage from 2009 in a three-year deal worth £240m. However, it may still land the rights to broadcast its first choice of Wednesday night matches in an auction today.
This year's F1 season got underway with the Australian Grand Prix in Melbourne last weekend, which was won by McLaren driver Lewis Hamilton. ITV's coverage of the race's qualifying session drew 1.7m viewers for its Saturday afternoon slot.
Dominic Coles, BBC Sport director of sport rights, said: "F1 is a crown jewel of sports broadcasting, so to bring the rights back to their traditional home from 2009 is tremendously exciting.
"Fans will be able to enjoy uninterrupted, state of the art and innovative coverage from BBC Sport across all of our TV, radio and new media platforms for the first time since 1996."
Bernie Ecclestone, president and chief executive officer of F1 Management, said: "It is an exciting time for in Formula 1 and the BBC has some innovative new ideas to consolidate and expand our UK fan base."