Australia needed two late goals to come from behind and beat Iraq 2-1 in a vital World Cup qualifying victory.
Needing three points following a shock loss to Jordan last month, Australia found themselves trailing late on once more after Alaa Abdulzehra broke the deadlock on the counterattack in the 71st minute.
But Tim Cahill levelled with a trademark header from a corner with 11 minutes left in the match, and substitute Archie Thompson headed in the winner in the 83rd minute.
Coach Holger Osieck will have left the Al Arabi stadium relieved to have his first win in the group but knowing his team are still far from their best.
The win moves Australia on to five points from their four matches so far, five points adrift of runaway leaders Japan.
The Socceroos, who host three of their last four matches, sit in the second automatic qualification position, level on points with Oman who beat Jordan 2-1 in Tuesday's earlier match, another to feature late drama.
Oman took a 62nd-minute lead through Ahmed Mubarak and then doubled the advantage in the 87th minute when Jumaa Darwish found the net.
But there was still time for a late scare with Thaer Bawab pulling one back for the visitors in the final minute.
The defeat leaves Jordan fourth on four points from as many matches.