BEIJING: Nastia Liukin danced as if she was in the ballet, lightly and elegantly across the floor mat, using her classical music as inspiration to float through her floor exercise.

There was no tension in her face, just exhilaration and a sweet lightness to her tumbling across the floor exercise mat. For a minute, the chance to win an Olympic all-around gold medal was not a burden but an opportunity for Liukin to explore the depths of gymnastics, to offer both the elegance that comes with experience and power of an athlete.

After being an underdog to her American teammate Shawn Johnson, Liukin won the all-around gold medal yesterday over Johnson. The bronze went to China’s Yang Yilin. Liukin scored 63.325, Johnson 62.725 and Yang 62.650. After two weeks of controversy about alleged under-age Chinese gymnasts, the all-around winner was a persevering 18-year-old who had to bite her nails at home during the 2004 Athens Olympics because she had barely missed the age cutoff - turning 16 during the Olympic season.

All this season Liukin finished second to Johnson through various rounds of US team qualifying and was second again to Johnson during the Olympic qualifying round Sunday.

But her father and coach Valeri spoke confidently this week. His daughter’s floor routine had become more secure he said, adding, “She’s rounding into form.”

And it was on floor where Liukin clinched her gold. Competing second to last and holding the lead, Liukin was a sparkling star. Even the Chinese crowd that had offered American competitors more muted praise during this meet gave her a loud ovation.

Johnson went last and pounded out her power-based routine. She didn’t make any mistakes and when Johnson finished, Liukin whispered in her ear, “Good job.” But when Johnson’s floor exercise score of 15.525 was posted, the exact same score Liukin had received, Liukin’s mouth opened wide and she flew to kiss her father.

The three leaders had finished in a row on the floor.

First Yang, the tiny 75-pounder from China whose age might be 14 or 15 or 16 depending on which documents you search for. Then Liukin, from Parker, Texas, who wore sparkling pink, and whose elegance and long lines are her advantage.