Seven days after the opening ceremony, the Russians were faced with a nightmare scenario.
Three gold medals in the first week left one of the great sporting powers languishing behind the likes of Kazakhstan and North Korea in the medal table.
Embarrassingly for a country keen to hype its first Winter Olympics in Sochi in 2014, the president of the Russian Olympic Committee spent his time on damage control, reminding the Russian public that they should not expect the sporting success of the Soviet Union.
Even reaching the 23 goals medals won in a disappointing performance in Beijing seemed out of reach, but a flurry of wins at the Olympic Stadium kickstarted a revival that left Russia with more medals than in 2008, although a record low fourth in the medals table.
The last gold was also the most dramatic, the men’s volleyball team storming back from match point down to beat runaway favorites Brazil.
Russia’s record athletics haul of eight gold medals included some memorable moments as Ivan Ukhov and Anna Chicherova won both gold medals in the high jump, while Mariya Savinova beat South Africa’s Caster Semenya to take the 800 meters title.
In a development likely to please President Vladimir Putin, the world’s most famous judo fan, the Russian team went from obscurity four years ago to become the most successful country, displacing even Japan.
Putin watched from the stands as Tagir Khaibulaev won Russia’s third judo gold before posing for photographers with the newly crowned champion, a product of a new system that matches the wrestling talent of Russia’s North Caucasus regions with top-notch international coaching talent.
There was even a triumph for one of Russia’s best-loved Americans as Boston-born David Blatt led the men’s basketball team to its first Olympic medal.
The thrilling 81-77 win over Argentina saw two new signings for the Minnesota Timberwolves, forward Andrei Kirilenko and guard Alexey Shved, combine for 45 points, just a month after the team had suffered the ignominy of having to qualify for the Olympics at a tournament in Venezuela, unlike most top-tier countries.
Despite the gold medal crescendo in the second week, Russians were also-rans in many finals, or failed to reach the finals at all in many sports - worrying signs for Sochi 2014.
Swimming, cycling, weightlifting and shooting, all traditionally strong areas for Russia, failed to produce a single gold medal, and the country’s team as a whole boasted worryingly few breakout stars.
There was also an unpleasant reminder Russia’s checkered Olympic past as Victoria Baranova, the world’s No. 2-ranked track sprint cyclist, was thrown out of the Games after testing positive for a banned substance, and later admitted to buying synthetic testosterone.
Elsewhere, Russia’s weightlifting squad saw an unusually large number of late withdrawals through injury or unspecified “medical reasons,” although none of the athletes was ever accused of wrongdoing.
As Russia prepares to host its first Olympic Games since the collapse of the Soviet Union, London has already been an example in one respect.
London’s much-praised army of 70,000 volunteer guides, stewards and greeters forms the blueprint for Sochi, where the organizers say they are inundated with applications, despite Russia having no real history of mass volunteering in modern times.
Prime Minister Dmitry Medvedev hinted that Danny Boyle’s acclaimed opening ceremony could inspire the Sochi effort - he suggested it would have a similarly idiosyncratic national character and could feature music stars, repeating a suggestion from an Internet fan that former Eurovision Song Contest winner Dima Bilan be drafted in.
For Russia, London offers signposts for organizing the Winter Olympics and inspiring examples of how to break into new sports - Russia’s well-funded short-track speed skating effort is importing foreign talent, much as the successful judo squad did.
Russia’s performance in London, with so many sports failing to deliver, also shows how things can go wrong. The fencing and shooting coaches both resigned shortly after their events finished and there may yet be more changes elsewhere, especially with an amendment to the law being debated that would allow the government to hire and fire the management of many sports federations.
The closing ceremony is set for later Sunday.