Great Britain won their first men's Olympic team medal in a century when they claimed bronze at the North Greenwich Arena.
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.
Team GB's artistic gymnastics team had initially been awarded silver but an inquiry into the score of Kohei Uchimura's pommel horse routine saw Japan claim silver and 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 home crowd. It came as a huge shock to both the gymnasts and the home crowd, with boos reverberating around the arena as Britain were stripped of their silver medal.
A medal of any colour would have exceeded all expectations for the British team with bronze looking like the best they could dream for against the gymnastics 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 United States 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 patiently waiting to learn their fate. When the result came through, delight turned to despair for Britain as they saw the silver medal slip through their fingers, meaning they took their place on the bottom step of the podium.
Prime Minister David Cameron announced the team's medal success as he opened a speech at a reception at the Royal Academy of Arts, as he said: "First of all, I bring you the important news from the Olympic Games, which is that the men's gymnastics team have won the bronze medal."
Mr Cameron's announcement was greeted with a huge cheer and applause.