Team GB have matched their medal total from London 2012 on the final day of the Tokyo Games.
That puts Britain on 65 medals - equalling their performance as hosts nine years ago and making Tokyo their second-most successful overseas Olympics after Rio 2016.
They claimed 22 golds, 21 silvers and 22 bronze medals in Japan.
Britain won 67 medals at the Rio Games - finishing second in the medal table - and UK Sport had set a medal target range of between 45 and 70 medals for these delayed Olympics.
GB's most successful female athlete, Laura Kenny, has been chosen to carry the British flag in Sunday's closing ceremony at 12:00 BST.
Simon Gleave, head of sports analysis at Nielsen Gracenote, said: "At Rio 2016, Great Britain became the first country to improve on its medal tally in the Olympics after being the host - and Team GB have now become the first to equal or win more medals at each of the next two Games."
The Team GB performance in Tokyo has exceeded pre-Games predictions of 52 medals and 14 golds - despite high-profile setbacks including a shock first-round taekwondo defeat for Jade Jones, injury issues for Dina Asher-Smith, Adam Gemili and Katarina Johnson-Thompson, and the withdrawal of potential gold medal shooter Amber Hill with Covid-19 before the Games started.
Team GB's medal aspirations were revised down by the governing body to take account of the "extraordinary circumstances" presented to athletes and staff in the build-up to the Games. UK Sport said success would also be measured in a "broader and more holistic" way than just medals.
Team GB won medals in 25 sports in Tokyo - more than any other country. We've grouped some sports together for this chartTeam GB have finished Tokyo 2020 in their lowest position on the medal table since the 2008 Games in Beijing despite matching their London 2012 totalTeam GB finish Tokyo 2020 with 22 gold medals, 21 silvers and 22 bronzes, putting them fourth in the medal table behind the USA, China and Japan - their lowest position on the medal table since Beijing 2008.
However, Gleave points out, this is still Team GB's second best performance at an overseas Olympics, after Rio 2016.
Tokyo 2020 is Great Britain's second most successful overseas Olympic Games - after Rio 2016King Kenny springs a surprise
Jason Kenny successfully defended his keirin title to become the first Briton to win seven Olympic gold medals.
Great Britain's most decorated athlete stunned the men's keirin field as he sprinted clear with three laps remaining to claim victory and his ninth Olympic medal overall.
After winning gold, the 33-year-old said he had "all but given up" before Sunday's final, but with October's World Track Cycling Championships around the corner and the next Olympics in Paris only three years away, he admitted he might have bought himself more time.
Jason Kenny's tally of seven golds is one more than former team-mate Chris HoyJason's wife Laura finished sixth in her bid for a third successive omnium title.
The five-time Olympic gold medallist said she felt "really tired" after winning gold alongside Katie Archibald in the madison on Friday.
The 29-year-old arrived at the fourth and final event - the points race - down in ninth position and 38 points adrift of top place after a crash in the scratch race but fought back to finish sixth overall.
The five-time Olympic gold medallist, who is the first British woman to win gold at three Olympic Games, has been named Team GB's flagbearer for the closing ceremony in Tokyo.
Price makes Welsh history in the ring
Lauren Price became the first Welsh fighter to win an Olympic boxing gold medal as she beat China's Li Qian in the women's middleweight final.
The former taxi driver won GB's 22nd gold medal in Tokyo with a 5-0 points victory at the Kokugikan Arena.
A former kickboxing world champion and Welsh football international, Price is also the reigning middleweight world, Commonwealth and European Games champion.
Her gold completes Britain's most successful Olympics in the boxing ring since 1920, with six medals - two golds, two silvers and two bronzes.