Iraq will play Australia on Saturday, when Iran faces South Korea as those nations meet in the quarterfinals for the fifth straight time. In Friday's quarterfinals, it's Japan-Qatar and Uzbekistan-Jordan.
Kerar Jassim scored in the 22nd minute for Iraq, which finished second in Group D and needed only a tie to advance.
In cities across Iraq, crowds of dancing, flag-waving fans blocked traffic and jammed into neighborhood squares to revel in their team's win. Security forces in camouflage uniforms stood on the sidewalks, on hand to keep the crowds under control but otherwise letting Iraqis enjoy a victory that brought together formerly warring factions.
As the game wound down, Iraqi state TV scrolled text messages across the bottom of the screen, warning jubilant fans to not fire celebratory gunshots after the game.
The TV texts didn't deter at least some Iraqi fans in Baghdad, who happily fired into the air as the game ended with the Iraqi win.
Iraq's politicians sent congratulatory messages on TV scrolls within seconds of the final whistle.
"The Iraqi prime minister congratulates the nation on its winning football team," read one, referring to Nouri al-Maliki, a Shiite. President Jalal Talabani and parliament Speaker Osama al-Nujaifi sent similar congratulatory TV scrolls.
Iran had already wrapped up top spot in Group D and used several reserve players in beating United Arab Emirates 3-0 on goals by Arash Afshin, Mohammad Nori and Walid Abbas. Each team had a red card.
North Korea, which qualified for last year's World Cup, and UAE head home without scoring a goal in Qatar.