American Paul Hamm survived a disastrous tumble on the vault to claim the men's gymnastics individual all-round Olympic gold medal.
The 21-year-old led at the halfway point but he fell from first to 12th after he failed to nail his landing.
Hamm scored 9.837 on his final high bar routine to recover and snatch gold with 57.823 points.
South Korea's Dae Eun Kim had to settle for silver while compatriot Tae Young Yang took the bronze.
"I thought after the vault I cost myself any medal," said Hamm. "My thought was I should shoot for bronze.
"I dug down deep and gave it everything I had on the
parallel bars and high bar.
"And after the high bar, my coach said 'All right Olympic champion', and I said 'what, no way'."
The contest was tightly poised ahead of the final rotation with Yang leading Kim by 0.138 of a point.
Kim seemed assured of gold when he scored a 9.650 performance on the floor excercise but his title rivals responded.
Yang produced a performance worthy of 9.475 on the high bar before Hamm delivered on the same apparatus to steal the crown.
Hamm repeated his victory at last year's world championship to become the first American to win all-round Olympic gold.
It is his second medal of the Games after he helped the USA to silver in the team competition.
Hamm's mistake was not the only one in the dramatic final as Chinese rival Yang Wei also slipped up to surrender his medal chances.
Wei had led with two apparatus remaining but lost his grip on the horizontal bar to slide down to seventh spot.