London won a two-way fight with Paris by 54 votes to 50 at the IOC meeting in Singapore, after bids from Moscow, New York and Madrid were eliminated.
Prime Minister Tony Blair called the win "a momentous day" for Britain.
Paris had been favourites throughout the campaign but London's hopes were raised after an impressive presentation by Lord Coe, the bid chairman.