Li Xuerui beats No.1 Wang for gold
Li, 21, prevailed 21-15, 21-23, 21-17 in a roller-coaster encounter lasting 78 minutes.
The World No.3 raced to a 19-10 lead in the first game before Wang mounted a short comeback.
At 19-15, Wang netted a cross-court net shot to hand her opponent a game point, which Li converted with a trademark drop.
Li went in front in the second game, but Wang took the initiative after winning an epic rally on an outrageous cross-court smash.
Li, who beat Wang in their last two major finals at the All-England Championships and the Asian championship this year, started finding the tram lines toward the end of the set as Wang kept her game together.
But Li's charge continued and she squandered two gold medal points before Wang turned it round.
Wang earned her own match point and took it with a straight smash that flicked off the net cord.
The deciding set went in waves, as Li would go three or four points ahead only for Wang to draw level.
The pattern took them to 17-all. Wang conceded two points cheaply, then Li smashed down the line for her third gold medal point.
She took the match with a non-returnable body smash, throwing her racquet into the air and letting out a squeal.
Earlier Saturday, India and Russia grabbed their first-ever badminton medals.
India's Saina Nehwal won women's singles bronze on Saturday when her opponent Wang Xin broke down with a knee injury after taking the opening game.
Before that, Russian pair Valeria Sorokina and Nina Vislova crushed Canada's Alex Bruce and Li Michele to take bronze in the women's doubles.
That competition was weakened considerably with the disqualification of four pairs, including China's No.1 seeds Wang Xiaoli and Yu Yang, for match fixing.