The show featured British celebrities and sportspeople, including David Beckham and Bradley Wiggins, and screen characters Mr. Bean and James Bond.
In a speech watched around the world, Games chief Jacques Rogge said: “The Olympic Games are coming home tonight.”
Flag-bearer Sir Chris Hoy earlier led out Team GB to cheers and applause.
The identity of who was to light the symbolic flame was shrouded in secrecy ahead of the ceremony.
The group of seven, chosen by British Olympic champions, each lit a single tiny flame on the ground, igniting 205 petals, one for each competing nation or territory.
Long stems then rose towards each other to form a cauldron, signifying unity.
The flame made a dramatic arrival via the Thames on a speedboat carrying Beckham, who handed the torch to Sir Steve Redgrave.
The show, billed as a quirky take on UK life, started with iconic images of London and Britain being beamed to the world, and all four countries of the UK being represented in song.
The field at the stadium in Stratford, east London, was turned into a green meadow, with sheep, horses, chickens, ducks and geese among the cast.
The show took the watching world through “great revolutions in British society”, from an agricultural setting through to the Industrial Revolution itself.
Steelworkers began forging material that transformed into golden Olympic rings, which appeared to float into the air to be suspended above the performers.
There were cheers too as the crowd saw a film featuring an unlikely meeting between the Queen and agent 007 James Bond.
“Good evening Mr. Bond,” the Queen said in the clip, before they left together, apparently heading towards the Olympic Stadium in a helicopter.
The aircraft then flew over the stadium to the sound of the Bond theme tune, as two figures parachuted down, one dressed as the monarch.
As if by magic, the Queen appeared in the stands – part of a crowd of about 80,000 – amid cheers.
James Bond was not the only much-loved British character to take part. Mr. Bean prompted laughter when he appeared as part of the orchestra playing the Chariots of Fire theme.
The ceremony also celebrated the National Health Service by featuring a cast of more than 1,000 volunteers recruited from hospitals across the country, including Great Ormond Street children’s hospital in London.
All the action was played out to a soundtrack of some of Britain’s most iconic bands – including the Clash, the Rolling Stones, Queen, the Sex Pistols and David Bowie – with Sir Paul McCartney performing live at the show’s close.
The athletes taking part in the Games – led by Greece, the Olympics’ spiritual home – made laps of the stadium bearing their nations’ flags.
A Red Arrows fly-past marked the start of the pre-show at the symbolic time of 20:12 BST.
And Bradley Wiggins, wearing a yellow jersey, rang the world’s largest harmonically-tuned bell to launch the opening ceremony.
As the “Isles of Wonder” show began, artistic director Danny Boyle pledged a ceremony with a theme of “this is for everyone”.
The Oscar-winning film director later tweeted: “Thank you, everyone, for your kind words! Means the world to me.”
Earlier, crowds of people, many of them dressed in their nation’s colours, streamed into the Olympic Park for the show.
Transport ran smoothly and the crowds moved quickly through security.
The day of celebration began at 08:12 BST with a mass bell ringing. Big Ben rang for three minutes for the first time since King George VI’s funeral in 1952.
The three-and-a-half hour show was rehearsed more than 200 times, with each of the 7,500 volunteers spending on average 150 hours practicing during the build-up.
The event used 12,956 props and boasted a million-watt PA system using more than 500 speakers.
Thousands of fans also gathered at other outdoor locations across the capital to watch the show on big screens.
I5rpRSOw7Ic gtoZSiDZ58k yVM0FzHlDVI hzfLRi31D10
Image source: Wikimedia Commons President-elect Donald Trump celebrated his election victory at the Ultimate Fighting…
Millions of voters across the US chose to return Donald Trump to the White House…
Donald Trump declares victory in the US election as he addresses jubilant supporters in Florida.…
Stocks around the world are rising as Donald Trump appears to be on the cusp…
Donald Trump has won Pennsylvania, North Carolina and Georgia and taken a lead over Kamala…
Quincy Jones, the celebrated musician and producer who worked with Michael Jackson, Frank Sinatra, Ray…