Australia put a dismal start to their first Asian Cup campaign behind them by thrashing co-hosts Thailand 4-0 to reach the quarter-finals.
Captain Mark Viduka scored two late goals in a ruthless display by the Socceroos which set up a mouth-watering last-eight clash with Japan.
Michael Beauchamp opened the scoring from a set-piece in the 20th minute before captain Viduka sealed victory with goals in the 79th and 83rd minutes.
Harry Kewell completed the rout with a goal in the last minute of normal time, confirming the one-time tournament favourites' return to form.
The two teams finished Group A level on four points in second place but Australia went through as runners-up based on their head to head result.
Iraq finished top of the group standings after playing out a scoreless draw with Oman. Iraq play Vietnam in the quarter-finals.
The Socceroos were in danger of an embarrassing early exit from the tournament after drawing 1-1 with Oman and losing 3-1 to Iraq but found their form in the nick of time at a packed Rajamangala stadium.