The game looked set to be decided by a penalty shootout before Matt McKay crossed from deep for Kewell to head into the corner past the despairing dive of Mohammed Kassid in the Iraq goal in the 117th minute.
Australia will face Uzbekistan in Tuesday's semifinals after Kewell's winner settled a nail-biting encounter and finally put to bed memories of Australia's ignominious exit on its debut four years ago.
Then, Australia went out on penalties to Japan in the last eight having begun the tournament as favorites following its switch from the Oceania region to Asia.
Australia also lost to Iraq in the group stage in 2007, and might have suffered the same fate on Saturday had Emad Mohammed's shot not dribbled just wide shortly after halftime.
Instead, Kewell was left to take the glory, swinging his shirt above his head in celebration as his teammates mobbed him.
At the final whistle, Australia coach Holger Osieck shook hands warmly with fellow German Wolfgang Sidka, who masterminded a creditable defense of the title Iraq won amid emotional scenes in 2007.
In a tight first half, Osieck's plan of subduing Iraq playmaker Nashat Akram paid off, while Sidka's side restricted Australia to half-chances.
The game opened up after the break.
Mohammed missed what would turn out to be Iraq's best chance after he was played in by Younus Mahmood, and that scare appeared to spark Australia into life as first Kewell volleyed wide, then Mile Jedinak, scorer in the last two games, put a long-range effort too close to the 'keeper.
From a corner in the 65th, Tim Cahill headed back across goal, only for Sasa Ognenovski to nod into Kassid's arms from a few yards out. Five minutes later, Iraq defender Ali Erhaima headed onto the roof of his own net after Cahill had won yet another header.
With nine minutes remaining, Kassid reacted quickly to tip over Brett Holman's deflected 25-yard shot, but Australia had to hang on for the final moments as Iraq, backed by an increasingly vocal support, pushed for a late winner.
Cahill failed to make it into extra time, his hardworking shift ending in the 90th minute, but Australia continued to create the better chances and Ognenovski connected beautifully with an overhead kick, only for teammate Jedinak to accidentally head it over bar.
Kewell, though, had the final say, finding space in between two defenders to power home his header and finally lift the tension hovering over Australia.
Australia: Mark Schwarzer, Lucas Neill, David Carney (Neil Kilkenny, 109), Sasa Ognenovski, David Carney, Luke Wilkshire, Brett Holman (Nathan Burns, 101), Harry Kewell, Matt McKay, Carl Valeri, Mile Jedinak, Tim Cahill (Scott McDonald, 90).
Iraq: Mohammed Kassid, Basem Abbas, Ali Erhaima, Samal Saeed, Salam Shaker (Ahmed Ibrahim, 75), Qusay Muneer, Nashat Akram, Hawar Mohammed (Ala'a Abdulzehra, 85), Mahdi Kareem (Mustafa Kareem, 63), Younus Mahmood, Emad Mohammed.