Paul Hamm (search) ought to get two golds for this performance.

With his medal hopes all but gone after he hit the judges' table on his vault landing, Hamm performed two of the most spectacular routines of his career to win the men's all-around gymnastics title by the closest Olympics margin ever.

"I'm happy right now. Shocked, actually," he said. "To be in first place after that kind of mistake, I thought there was no chance to win."

Hamm needed a 9.825 on the high bar, his best event, to tie Kim Dae-eun of South Korea for gold -- and he was dazzling. The highlight of his routine are three straight release moves, and he did them perfectly Wednesday night to become the first U.S. man to win the event.

The reigning world champion from Waukesha, Wis., Hamm threw himself up and over the bar, catching it on the way down once, twice and then a third time, soaring higher with each toss.

Hamm's dismount was perfect, and he hit the mat with a solid thud before thrusting his fists into the air and throwing his head back in amazement. He waved at the roaring crowd and then sprinted off the podium clapping his hands while his coach, Miles Avery, jumped up and down on the sideline.

"I thought I could win silver, maybe bronze," Hamm said. "I didn't think I could win gold until Miles said, 'You're the Olympic champion,' and all I could think to say was, 'No way!'"

Oh, yes. Hamm finished with 57.823 points, beating Kim by .012. The previous closest margin in the event was .017 by Leon Stukelj of Yugoslavia over Robert Prazak of Czechoslovakia in the 1924 Games. The women also had .012, in 1992, when Ukraine's Tatyana Gutsu edged American Shannon Miller.

"I thought maybe I could get first," Kim said. "I'm rather disappointed and angry, in a way."

Yang Tae-young of South Korea won the bronze. Brett McClure of the United States finished ninth. He had been fourth going into the final rotation, the still rings, but that's his worst event.

"I took a picture of the scoreboard after five events, because I knew I was going to drop," McClure said.

After Hamm's victory, Avery grabbed him in a bearhug. His opponents did the same, then Hamm dropped into a chair, overwhelmed by what he had done. When his score of 9.837 flashed on the scoreboard, the arena went into a frenzy.

"We all knew that Paul was the best coming in," said Bob Colarossi, president of USA Gymnastics (search). "To fall and then have to do a perfect routine to win it and stick the landing, is incredible."

As the world champion, Hamm was the clear favorite. And the gold medal appeared to be within his grasp when he took a .038 point lead over China's Yang Wei (search), his biggest rival, halfway through the meet.

Vault is usually one of Hamm's strongest events. He looked good when he hit the springboard and leapt forward, turning his body sideways before his hands hit the horse.

Springing backward, he did 11/2 somersaults, but he didn't get enough height on the twists and hit the mat in a crouch. He had no chance to stabilize himself, his left leg crossing over the right and sending him on a sickening stumble.

"I don't know how that happened," Hamm said. "It felt good in the air."

The crowd gasped as Hamm fell sideways and back off the mat, hitting the edge of the judges' table before he plopped down, a stunned look on his face. He got up and walked off the podium, shaking his head and thinking he'd probably just cost himself the gold.

Hamm looked dazed when he saw his score of 9.137, which dropped him all the way to 12th place and more than a half-point behind Yang -- an almost insurmountable deficit. He still had two events to go, but he had to be absolutely perfect and hope that one of the gymnasts in front of him would make a mistake.

"I thought it was done," Avery admitted. "He was in 12th place. I looked at the scoreboard and said it's a long, long climb, because I know the quality of the gymnasts out there."

Hamm did his part on his next event, the parallel bars. Going first, he flipped from one handstand right into another on the delicate bars, still as a marble statue. His dismount was textbook perfect.

His score, also a 9.837, was the highest on the parallel bars, moving him up in the standings. But he needed help, and he got it as, one by one, his competition fell away.

First went Yang, who lost the gold medal to Russian star Alexei Nemov in Sydney four years ago and then finished second to Hamm at last year's worlds.

Doing a one-armed pirouette on the high bar, Yang reached to grab the bar with his free hand and came away empty. Swinging wildly like a kid on monkey bars, Yang tried to hang on but couldn't, dropping to the ground and taking his medal hopes with him.

Isao Yoneda of Japan fell on a similar move. Ioan Suciu of Romania stalled on a handstand. Marian Dragulescu couldn't keep his arms locked on a flip on the parallel bars, sinking well beneath the bar with his legs flailing.

When the rotation finally ended, Hamm had moved all the way back to fourth place, only .313 points out of first.

"Sure, he was a little frustrated" after the fall, McClure said. "But the great ones take that frustration and direct it toward an event and put up a huge number. And then, BOOM!"

Competing on floor, Kim's routine was solid but not spectacular. He looked up as he walked off the floor, then went to the sideline to wait. About five minutes later, it was Yang's turn on the high bar. His routine was serviceable, too, but hardly golden, and a small step on his landing gave Hamm a chance.

He made the most of it.

Hopping up and down as he waited, Hamm was the picture of calm once he stepped on the podium. Starting with slow swings, he quickly built momentum.

Jerking back on the bar as if to get as much power as he could, Hamm began his release moves, blind throws more than 10 feet in the air that some acrobats wouldn't try.

But Hamm has a way of making it look easy. And now he has a gold medal to show for it.

"I dug down deep and fought for everything," he said. "It was the best performance of my life."