Australia 2-1 Serbia
Superb goals from Tim Cahill and substitute Brett Holman saw Australia win and both nations exit the tournament
Radomir Antic's team were given late hope of claiming the draw that would have seen them finish second in Group D, ahead of Ghana who were losing, simultaneously, to Germany.
A rare mistake from the Australia goalkeeper Mark Schwarzer saw him mishandle a long shot from Zoran Tosic, presenting Serbia replacement Marko Pantelic with a routine, close-range conversion.
However, in the six remaining minutes, Pantelic twice wasted promising situations by straying offside and Serbia were thwarted with a penalty appeal after a Nemanja Vidic header struck Cahill's hand.
Australia, who had never beaten a European team in a World Cup tournament, ultimately ended what had been a disappointing competition, with a player sent off in each of the previous two games, on a winning note and only failed to reach the knock-out stage on goal difference.
Cahill rose superbly in the 68th minute to meet Luke Wilkshere's right-wing cross and steer his header beyond the dive of Vladimir Stojkovic from the penalty spot.
More remarkably still, Holman collected a loose ball around the halfway line five minutes later and advanced to the 25-yard mark before sending a magnificent right-foot shot into the opposition goal.
Serbia were made to pay for their first half display in which they failed to turn their abundance of possession, and openings, into goals.
Right-winger Milos Krasic, the most influential performer of that period, forced Schwarzer into a sharp, early save before missing the target on a promising counter-attack.
Schwarzer also saved well from Branislav Ivanovic before Nikola Zigic, the giant Serbia target man, met a cross from Ivanovic with a header that flew woefully wide of the target.
Australia, who had only threatened with speculative efforts over the first hour, began to exert greater control on the game, especially after the arrival of the energetic Holman. Jason Culina threatened from distance before a Marco Bresciano free-kick was turned around the post by the goalkeeper.
The same, Italian-based, midfielder then unleashed a long shot which Stojkovic almost diverted straight into the path of Cahill, who came within inches of being able to open the scoring - a feat he would achieve, in any case, minutes later.
Australia (4-5-1): Schwarzer; Wilkshere (Garcia 83), Neill, Beauchamp, Carney; Emerton, Culina, Cahill, Valeri (Holman 65), Bresciano (Chipperfield 65); Kennedy.
Subs (not used): Federici, Galekovic, Milligan, Jedinak, Rukavytsya.
Serbia (4-4-2): Stojkovic; Ivanovic, Vidic, Lukovic, Obradovic; Krasic (Tosic 62), Ninkovic, Kuzmanovic (Lazovic 77), Stankovic, Jovanovic; Zigic (Pantelic 67).
Subs (not used): Isialovic, Djuricic, Rukavina, Kolarov, Subotic, Kacar, Milijas, Petrovic, Mrdja.