Louis Smith, Max Whitlock, Daniel Purvis, Sam Oldham and Kristian Thomas scored a total of 271.711 as they produced a stunning team performance in front of a royal audience.
Britain had initially been awarded silver but an inquiry into the score of Kohei Uchimura's Pommel Horse routine saw Japan claim silver and Great Britain downgraded to bronze.
China retained their gold medal with 2008 silver medallists Japan leapfrogging Britain's score of 271.711 with an upgraded total of 271.952.
The Duke of Cambridge and Prince Harry led the support as Britain won their first Olympic Team medal since the bronze at the Stockholm Games in 1912 to thunderous applause from the Host Nation crowd.
A medal of any colour would have exceeded all expectations for the British team and bronze had looked like the best they could aim for against the powerhouses of the United States, Russia, China and Japan.
In a tense finale, it looked as if they had done enough to secure the bottom step on the podium after going head-to-head with Ukraine on the last piece of apparatus as the USA faded away.
Ukraine were in bronze medal position and Japan in silver with the final rotation to go, but brilliant performances on the floor by Whitlock, Purvis and Thomas saw them seal their place on the podium, as Japan faltered and finished in fourth.
However, there was a twist in the tale, as Japan launched an inquiry into three-time world champion Uchimura's score, leaving Britain waiting to learn their fate.
In the pool, Ruta Meilutyte claimed a gold medal for Lithuania in the women's 100m Breaststroke.
The 15-year-old led from start to finish to touch in 1:05.47 seconds as she held off a fast-finishing Rebecca Soni, the Beijing silver medallist.
American Matt Grevers claimed the 100m Backstroke crown in a new Olympic record while his countrywoman Missy Franklin took the women’s equivalent and Frenchman Yannick Agnel won the 200m Freestyle to claim his second Olympic title in 24 hours.
Romanian shooter Alin George Moldoveanu won a titanic tussle with world number one Niccolo Campriani of Italy to claim Olympic gold in the men’s 10m Air Rifle.
There were gold medals in the Judo for Japan's Kaori Matsumoto in the women's -57kg division and Russian Mansur Isaev in the men's -73kg division.
China’s Li Xueying took the gold in the women’s 58kg Weightlifting division while Kim Un Guk triumphed to win gold in style in the men's 62kg competition which saw Olympic and world weightlifting records tumble.
Chinese divers Cao Yuan and Zhang Yanquan claimed victory in the Synchronised 10m Platform and in Tennis at Wimbledon, top seed Roger Federer eased into round three with a 6-2 6-2 victory over Julien Benneteau while, in the women’s event, Serena and Venus Williams claimed straightforward victories but world number one Victoria Azarenka was taken to three sets by Romania's Irina-Camelia Begu.
Elsewhere, Yana Shemyakina won Ukraine's first-ever individual Fencing gold at the ExCeL in the women's Epee to round off an amazing day.