Victoria Pendleton was denied a fairytale farewell on the track as she lost her Olympic sprint title to Australia's Anna Meares.
Pendleton won race one of the three-leg final against Australia's Meares by 0.001 seconds but was disqualified for riding out of the sprinting lane.
The Briton - the defending champion - tried to hit back in race two.
But a stunning Meares finish gave her a 2-0 win and left Pendleton with silver.
Guo Shuang of China took bronze after beating Germany's Kristina Vogel 2-0.
"I would have loved to have won on my final race, but I'm just so glad that's it all done and I can move on," said Pendleton."
Defeat by her fiercest rival was an unhappy end to Pendleton's illustrious career on the track, but the six-time sprint world champion has the consolation of taking keirin gold away from London 2012.
Meares, in contrast, came into the final with only a bronze from the team sprint to her name at London 2012, but the 28-year-old left with Australia's first gold medal in the velodrome of these Games.
The two riders have enjoyed some epic duels on the track in the past and their first cat-and-mouse encounter did not disappoint.
Meares stalked Pendleton like a tiger around the track and won the first race after the British rider was adjudged to have come out of her lane as she held off the Australian by the width of a tyre.
That left Meares needing just one more win to take gold, which she sealed with a burst of speed on the final bend that left Pendleton unable to respond.
Tears followed from an emotional Pendleton, whose dream of becoming the first British woman to win three Olympic golds was dashed.
However, her two golds mean she remains alongside runner Kelly Holmes, swimmer Rebecca Adlington, fellow track cyclist Trott and sailors Sarah Webb, Sarah Ayton and Shirley Robertson as the country's most successful female Olympians.
Meares, meanwhile, was left to celebrate her second Olympic gold medal, eight years after she won her first in the 500m time trial in Sydney.
"Victoria's such a hard-fought opponent and she's dominated the sport for so long," said Meares. "It's been such a difficult challenge and to be able to win the Olympic title for me, it's so special."