Sir Chris Hoy claimed a sixth Olympic gold medal to become the most successful British Olympian of all time.
Having won gold on the first night of the track cycling in the men's team sprint, Hoy's triumph in the keirin was the perfect finale for Team GB.
Hoy's six golds take him past rowing great Sir Steve Redgrave's five.
And with a silver from Sydney 2000 as well, he equals Bradley Wiggins's record total of seven medals.
The 36-year-old Scot is sure he will not carry on for a fifth Games in 2016, but he is already assured of his status as track cycling's greatest ever sprinter.
Hoy, the defending Olympic and four-time world champion, hit the front with a lap to go and while he was momentarily overtaken by Germany's Maximilian Levy on the back straight, he came roaring back to win by a bike length.
Levy, the silver medallist at the World Championships in April, had to settle for second again, with Teun Mulder of the Netherlands and Simon van Velthooven of New Zealand crossing the line together for third and a bronze medal each.
"I'm in shock. You try to compose yourself but it's surreal," said Hoy. "I wanted to win gold in front of my home crowd. I saw everyone stepping up to the plate and thankfully it worked out for me too.
"The keirin is a lottery and you never take anything for granted in it. I can't describe the feelings I have at the moment. This is enough for me - this is the perfect end to my Olympic career.
"I can't put into words what it means to me. It's one of the greatest feelings I have ever had.
"I'm 99.9% sure I won't be competing in Rio. How can you top this? [The 2014 Commonwealth Games in] Glasgow is another question, as that would be the dream ending for me."
With a combination of bravery, cunning and power, the keirin, the final track cycling race of the Games, is always a favourite with the crowd.
An eight-lap race, the six riders spend the first five and a half of those riding behind a small motorbike, or derny.
The speed is slowly ratcheted up before the derny peels away to unleash an almighty charge for the line.
This most vocal of London 2012 audiences emphatically underlined the British team's domination of the last six days in the velodrome: 10 events, seven golds, a silver and a bronze. And the only medal missing was in the women's team sprint, the event that saw Pendleton and Jess Varnish disqualified when a place in the final was theirs.
Most experts said Team GB could never repeat the success achieved by the track cycling team in Beijing 2008. Most experts were wrong.