Updated

Shawn Johnson of the United States finally got her Olympic gold medal, in the last event of the women's competition Tuesday night, the balance beam.

Johnson, bothered by a headache before the competition, nailed her routine that was full of difficult tricks, earning a 16.225.

"This is what we expected to see," said her coach Liang Chow. "The thing I really am pleased with is she was a little under the weather and she still was able to do a wonderful routine."

The world champion, who already had a silver behind fellow American Nastia Liukin in the all-around, and a silver on floor and in the team event, edged Liukin, who finished with a gold, three silvers and a bronze.

Cheng Fei of China took the bronze, giving China six women's medals, two behind the Americans.

"This was the right ending to conclude the Olympic Games," national team coordinator Martha Karolyi said. "We proved the supremacy of U.S. women's gymnastics.

"I feel excellent [about Johnson]. I think she needed this so much. She proved she is absolutely a great balance beam gymnast."