China's defending champion Lin Dan became the first badminton men's singles player to win the Olympic title twice as he overcame his great rival Lee Chong Wei 15-21, 21-10, 21-19 in a magnificent final Sunday.
Malaysian top seed Lee, who had almost missed the Games because of an ankle injury, faded a little from the middle of the second game, allowing Lin's magnificent range of strokes to flourish.
When Lee's final shot dropped long, Lin, often described as the best player in badminton history, sprinted round the stadium, ripped off his shirt and wept in celebration, saluting the crowd as he held the Chinese flag.
Meanwhile Lee cut an inconsolable figure as he sat alone on the empty court.
It was China's fourth badminton gold medal, keeping alive its chances of becoming the first nation ever to win all five ahead of the men's doubles final later on Sunday.
But there were moments, especially when Lee was leading 18-16 in the final game, when it seemed he would sensationally his avenge defeats to Lin in the Beijing Olympic final and the world title-match in the same arena last year.
Lee claimed to have had only two weeks training after suffering a serious ankle injury in June. But he lasted the 79-minute thriller extraordinarily well.
In the end, however, Lin was just a little mentally stronger, and was able to make use of an unequalled repertoire of strokes in which the element of surprise is always present.
His extravagant celebration must have accentuated the misery of Lee, who has spent 199 weeks as world number one, as he lost yet another major final to his career nemesis.
It was often a cat-and-mouse contest with both men coaxing the shuttle accurately around the court in mesmeric patterns, mixed with sudden lunges and unpredictable pounces on anything too short at the back or too high at the net.
Lee, who had looked below his best pace for much of the tournament, moved much better than before, perhaps given adrenaline by huge crowd support.
He was also helped by a line decision which got him to 11-8 at the first game interval.
Lin appeared to have placed a smash from a short lift perfectly on the line, but it was called out, causing the defending champion to stare at the line judge and look at the umpire before taking his place at the side of the court.
Three rallies later, Lin caused a sensation. Lee struck an attempted kill from the net past his opponent in the forecourt, only for Lin to turn and overtake the shuttle, retrieving it well enough to continue the rally and win the point.
But there were also three costly errors by the champion, allowing Lee to advance quickly to 16-11, and that was a deficit which proved too great to reduce against a visibly encouraged Lee.
There was however a tidal shift in the flow of the match after a dozen rallies in the second game.
It happened after Lee made a brilliant kill at the net, rolled from almost below the height of the tape, levelling the scores at 6-6, and bringing a fist-pumping celebration.
This may have triggered something in Lin because he upped the pace, with a dynamic jump smash which got him to 8-6 and an acceleration which carried him to 11-7 and then to 17-8.
The third game saw Lee make another remarkable push, getting to 8-5 and then almost to 9-5 when the line judge strangely called Lin's shot out, before being over-ruled.
By the interval he was at 11-9 and he reached 13-12 before Lee made his last spectacular surge, summoning what remained of his energy to launch three winning smashes, two of them spectacular airborne efforts.
That got him to 15-13, and to 18-16, but from 19-18 he was mostly just hanging, using his rhythmic movement and tactical lift, clear, drop patterns to stay in the match.
Two big attacks from Lin at 19-19 proved unstoppable. Lee, meanwhile, will have rescued more than enough honour to try another day, perhaps for a world title.
Neither however will play another Olympics. As a farewell to the Games, it provided almost everything that could have been hoped for.