Wieber, who led the Americans to the team title on Tuesday, won despite making mistakes on uneven bars and floor exercise. She finished with 59.382 points, just 0.033 ahead of Komova. China's Yao Jinnan won the bronze, and Aly Raisman of the United States was fourth.

Wieber had a big form break on uneven bars, leaving her trailing Komova by more than a point midway through the meet.

Wieber pared the lead in half with a spectacular balance beam routine to go into the final rotation a half-point behind Komova, the Youth Olympic Games champion. The 16-year-old seemed resigned to silver after going out of bounds on her third tumbling pass.

But while Komova's routine was clean, it was less difficult and didn't have the same spark as Wieber's, who became the sixth American to win gymnastics' biggest prize at worlds.

"I definitely thought I was going to end up with silver," said Wieber, who burst into tears when she saw the final score. "I'm so surprised." Komova was the only gymnast in the top-five not to make a mistake.

"I'm very disappointed," Komova said through a translator, her face sullen. "I'm very upset." Most had expected the gold duel to come down to Komova and Wieber with defending champion Aliya Mustafina missing to a knee injury.

The American performed first and she seemed to lose rhythm as she pirouetted on the high bar. It caught up with her when she flipped to the low bar and although she didn't fall, she swayed and looked as if she might have scraped her toes on the mat. She scored a 13.6, more than a point less than she had in qualifying.

Komova's routine, on the other hand, was almost flawless.

Lithe and long, the Russian floated between the bars in a smooth manner. Her dismount — two back somersaults with a twist — was acrobatic, yet she landed almost daintily. Her score of 15.4 moved her ahead of Wieber by a little more than a point.

Wieber cut Komova's deficit in half going into the final rotation with a dazzling routine on balance beam for a high score of 15.266.

Wieber's saucy floor number led to some huge height on the opening pass but she also got a little too much power on her third pass and had to take a big step out of bounds. That mistake looked likely to end her chances at the title, especially with Komova being mostly clean on floor.

But Wieber's passes were higher and her form was just a little better and that, in the end, made the difference between silver and gold.

"It means so much to me," said Wieber, who like Komova was competing in her first worlds. "It's a dream come true."