Australia produced a rousing second-half display to knock Serbia out of the World Cup - but it was not quite enough for the Socceroos to sensationally earn a place in the round of 16.
A Tim Cahill header and a searing long-range strike from substitute Brett Holman ensured that at one point Pim Verbeek's side were two goals away from snatching second place in Group D.
However, that berth was ultimately claimed by Ghana, who lost 1-0 to Germany to finish level on Australia with four points but who go through by virtue of their superior goal difference.
As the clock ticked down it seemed as though the momentum of the contest had swung firmly in the favour of the green and gold but their hopes of emulating their exploits in 2006 by progressing from their group were effectively ended when substitute Marko Pantelic pulled a goal back for Serbia after 84 minutes.
In the end it was a disappointing night for both sides, with the Socceroos left to rue the damage done to their campaign by the 4-0 thrashing they sustained in their opening game against Germany.
And in many ways it was even more agonising for Serbia, who finished the match one goal away from snatching second place away from Ghana.
A draw would have taken Serbia on to four points and above Ghana on goals scored.
That almost happened in the dying seconds of what ended up as an absorbing end-to-end contest but Pantelic smashed a cross from the right wide of the target.
Many people had tipped Serbia to be a surprise package in the tournament - a school of thought given further weight after they defeated Germany in their second game.
And in the first half at the Mbombela Stadium in Nelspruit there seemed little doubt that they would win the contest after producing a performance of attacking intent against an off-colour Australia.
Milos Krasic operated on the right flank, directly in front of the bulk of the Australia supporters during an opening 45 minutes that saw them boo him every time he touched the ball.
They were incensed by what they thought was a blatant attempt to win an early penalty after the CSKA Moscow player went down in the Socceroos area as he tussled with Carl Valeri.
But it had little impact on Krasic's performance as Serbia, with swift, precise passing, kept their dogged opponents on the back foot.
Mark Schwarzer was clearly Australia's best player as he palmed an early Krasic strike around the post and made a sensational one-handed save to thwart Chelsea's Branislav Ivanovic.
Raddy Antic's side occasionally had only themselves to blame for not taking the lead, as Krasic really should have found the net after collecting an inch-perfect threaded pass from Zdravko Kuzmanovic and rounding Schwarzer, but he shot over.
Australia, with their tall target man Josh Kennedy a peripheral figure, created precious little in the opening half; Cahill, returning after suspension, headed wide while Kennedy at least drew a save from Vladimir Stojkovic with a weak effort.
It looked as though Verbeek's tenure as Australia boss was going to end tamely but his side showed great spirit after the interval, even if opportunities initially remained at a premium.
Jason Culina shot wide from long range, while Marco Bresciano drew two saves from Stojkovic, the second of them a rasping effort from 20 yards.
However, the complexion of the contest changed irreversibly when Cahill brilliantly headed Australia in front from a right-wing cross.
Germany had taken the lead against Ghana by that stage - and when Holman's sensational long-range strike defeated Stojkovic the atmosphere generated by the considerable Australia following was sensational.
Serbia, who failed to reproduce their first-half form, pulled a goal back through Pantelic after a rare error from Schwarzer, who spilled a long-range strike from Zoran Tosic.
Antic's team wanted a penalty for a handball against Cahill but they only had themselves to blame for failing to score a second when Pantelic missed.
Attempts on target
Attempts off target
Projected table based on current scores
|Group A teams||P||W||D||L||F||A||GD||PTS|
|Group B teams||P||W||D||L||F||A||GD||PTS|
|Group C teams||P||W||D||L||F||A||GD||PTS|
|Group D teams||P||W||D||L||F||A||GD||PTS|
|Group E teams||P||W||D||L||F||A||GD||PTS|
|Group F teams||P||W||D||L||F||A||GD||PTS|
|Group G teams||P||W||D||L||F||A||GD||PTS|