The tone for a dramatic day was set early, as Patrick Mills hit a three-pointer on the buzzer as Australia snatched an 82-80 victory to end Russia's unbeaten run.
Russia had their first lead since midway through the fourth quarter when Vitaliy Fridzon went to the line and hit two free throws to make it 80-79 with 4.1 seconds left.
But Australia coach Brett Brown drew up one final play and they made it pay as Joe Ingles fed Mills at the top of the key and he shot the three to win it.
'I had the mindset that if I was open I had to shoot, time was running down and I was glad that it went in,' Mills said.
Russia had already sealed top spot in the group while Australia knew they could not improve on fourth place, with both teams advancing to the quarter-finals.
And they were joined there by Lithuania, who booked their last-eight place after overcoming Tunisia 76-63.
The Europeans, who have reached the semi-finals of every Olympic Games since they gained independence, winning three bronze medals, risked elimination as Tunisia led most of the game and were up by double digits late in the third quarter.
But instead they took control with an outstanding fourth-quarter display, outscoring Tunisia 33-9 over the final 12 minutes.
Elsewhere, favourites the USA wore down battling Argentina in the second half to seal top spot in Group A with a 5-0 record, following a 126-97 win.
Argentina matched the Americans blow-for-blow in a pulsating first half, trailing 60-59 at half-time.
But the Americans outscored them 42-17 in an incredible third quarter in which the red-hot Kevin Durant hit five three-pointers from increasing distance.
Both sides collected technical fouls in the fourth quarter, but the USA took charge to see out the game.
In Group A, France quelled the threat of a second-half fightback from Nigeria to secure the second seed with a 79-73 win.
Nicolas Batum scored 23 points and Mickael Gelabale added 11 but France did not have it all their own way with Tony Parker largely quiet and Chamberlain Oguchi going off for 35 points for Nigeria.
Great Britain recorded their first Olympic Games victory in Basketball since 1948 as they beat China 90-58 in their final Group B game.
Meanwhile, Spain's medal hopes suffered another blow as they surrendered a late lead to lose 88-82 to Brazil.
World number two and European champions Spain had led virtually the entire game, often by double digits, and were still up 73-67 with 5:43 left to go after Pau Gasol split a pair of free throws.
But then the game very quickly became the Leandro Barbosa show as he took charge to lead the South Americans to the win.