With about 83 percent of the votes counted from parliamentary elections, it's not at all clear that Prime Minister Nouri al-Maliki will emerge the winner because a secular challenger is showing surprising strength. And a drawn-out battle of negotiations with rival coalitions is inevitable.
"Al-Maliki is fighting for his political life," said Joost Hiltermann, an analyst at the International Crisis Group. "He may well come out of this no longer prime minister. He may lose the elections, that is how close it is."
The prime minister, known as a hardline Shiite during his first couple of years in power, has more recently transformed himself into a law-and-order nationalist who has occasionally reached out to minority Sunnis. While trying to re-establish a strong central government — most notably by routing a Shiite militia that ruled parts of Baghdad and Iraq's second-largest city, Basra — al-Maliki has also alienated many key constituencies by governing with a heavy hand.
Al-Maliki campaigned with all the benefits of incumbency: easy air time on national TV, the ability to dole out favors to local officials in exchange for their support, and a record of helping stop some of the country's violence.
But the political bloc loyal to al-Maliki has only a slim lead over the secular coalition led by Ayad Allawi, a Shiite who himself was prime minister from 2004 to 2005.
Allawi's anti-Iran rhetoric — and the many Sunnis in his Iraqiya coalition — earned him Sunni support in Baghdad and in Sunni-dominated provinces such as Anbar and Salahuddin.
Al-Maliki has been doing well in the Shiite south as well as in Baghdad, a city of 6 million people accounting for almost a fifth of the 325 parliament seats.
With about 12 million votes cast in the March 7 election, the prime minister's coalition has about a 40,000-vote lead over Allawi and is ahead in more provinces — an important factor considering that parliament seats are divided by province and not by the overall vote count.
The process of choosing the next prime minister could take months — a situation which could invite violence at a time when the United States has vowed to stick to President Barack Obama's timetable that calls for the withdrawal of combat forces by late summer and all American troops by the end of next year.
Once election results are final and the parliament is seated, the lawmakers will elect a new president. The president then tasks the bloc with the largest number of seats to form a majority government.
But even if the president gives al-Maliki the nod, it's not clear he could form a governing coalition and retake the prime minister's office. Almost four years in office have left a long roster of important people and constituencies angry with him.
Followers of anti-American cleric Muqtada al-Sadr are still miffed at al-Maliki for ousting Sadrist militiamen from the oil city of Basra.
Another Shiite religious party, the Supreme Islamic Iraqi Council, blames al-Maliki for splitting the Shiite vote.
And the Kurds, who like the Sunnis make up about 15-20 percent of Iraq's population, have their own grievances. Those include disputes over who controls oil drilled in Kurdish lands, and the future of Kirkuk — a northern city claimed by both Arabs and Kurds.
The Kurds are widely considered crucial to putting together any government in Iraq. Allawi and other leaders practically sprinted up to the Kurdish city of Sulamaniyah in the days after the election.
The Kurds appear ready to drive a hard bargain for their support.
"The Kurdish coalition won't make any alliance with any bloc without a signed agreement in order to guarantee that our demands will be implemented," said Fadhil Mirany, a senior official with the Kurdistan Democratic Party. "We will form an alliance ... on the basis of what we get."
But a new Kurdish political party called Gorran — Change in English — has been eating into the two main Kurdish parties' political power base, possibly upsetting the unified front that has always made the Kurds a formidable political force able to throw their weight behind a single candidate.
Looking to shore up his Shiite support, al-Maliki has been making overtures to the Iraqi National Alliance, a wide-ranging Shiite religious alliance with Iranian backing. Al-Maliki was to meet Wednesday night with Ammar al-Hakim, a key leader within the INA, said Khudhair al-Khozaie, a candidate on al-Maliki's list.
"We are having meetings with most all of the blocs, but absolutely the closest bloc for us is the Iraqi National Alliance," al-Khozaie said.
But preliminary election estimates indicate that the largest bloc within the INA is led by al-Sadr, the unpredictable cleric who could just as easily break off from INA and throw his weight behind Allawi as he could behind al-Maliki.
"Muqtada al-Sadr is the dark horse in this race. He is not necessarily going with INA, he may make up his own mind and he seems partly more inclined to go with Allawi because he still resents al-Maliki for going after his militiamen," said Marina Ottoway of the Washington-based Carnegie Endowment for Peace.
But she said Allawi might find al-Sadr "too dangerous" to include in his coalition.
If al-Maliki will have a hard time forming a government, Allawi may fare even worse.
Allawi drew on massive support from Sunnis, the favored sect during Saddam Hussein's reign who clearly decided that Allawi was their best hope at regaining influence. But that same Sunni backing can be a hindrance when courting the Kurds — both Kurds and Arabs claim the oil-rich city of Kirkuk and disputed provinces stretching from Syria to Iran.
If not Allawi or al-Maliki, could a surprise candidate be tapped to form a government? The prime minister was himself a compromise choice in 2006 to run the country.
Names being mentioned include Ibrahim al-Jaafari, a former prime minister who ran in the INA's coalition, and Ahmad Chalabi, the one-time Pentagon favorite who also ran in the INA coalition.
But Ottoway, the analyst, said in the long run it may come back to the two men battling it out right now.
"I just don't think there is going to be another prime minister than either al-Maliki or Allawi," she said.
Associated Press writers Katarina Kratovac and Mazin Yahya in Baghdad and Yahya Barzanji in Sulamaniyah contributed to this report.