Iraq's parliament has approved key leadership positions in the first step towards forming a new government after a breakthrough deal which returns Shiite Prime Minister Nouri al-Maliki to office.
Mr al-Maliki and his top rival Ayad Allawi, who had hoped to take the prime minister's post at the top of a Sunni-backed coalition, sat next to each other in the chamber in an apparent sign of unity after an eight-month political fight over the formation of the government.
Iraqi lawmakers later elected Kurdish leader Jalal Talabani as president, despite a dramatic walkout by a Sunni-backed bloc, and he was immediately sworn in. Mr Talabani's election was part of a deal hammered out by Iraqi lawmakers to end an eight-month deadlock over who would lead the new government. The Sunni bloc's lawmakers had demanded that before parliament vote on the president, it vote first to formally dissolve decisions by a De-Baathification programme purging former members of Saddam Hussein's ruling party which had barred three of their members from taking part in government positions.
The deal is potentially a setback for the US, which had been pushing for a greater Sunni say in power, and a boost for regional rival Iran. The Sunni minority had put great hopes in the March elections and succeeded in lifting their bloc to a narrow victory, only to be outmanoeuvred by Iranian-allied Shiites who preserved their domination of the new government. A parliament vote on the government could still take several weeks, as the factions work out the details of who gets what posts. But the session on Thursday paved the way with the first formal steps, starting with the naming of a speaker.
Under the agreement, the post went to a figure from Mr Allawi's Iraqiya bloc - Osama al-Nujaifi, a Sunni hard-liner who holds staunch support among his community in northern Iraq but is widely hated by Kurds. His power and personality may be able to bring more authority to what has been a lacklustre position in the past.
Sunnis appeared to be grudging junior partners in what could be a fragile government.
"I don't think we got what we wanted. We are the biggest bloc, and we won the election," said Jaber al-Jaberi, an Iraqiya MP from the Sunni stronghold Ramadi. "We earned the right to form the government. However, there were powerful forces ... and we compromised."
He warned that Iraqiya could withdraw its support if Mr al-Maliki does not follow through with his promises. "We can always change our minds. We have 91 seats in the parliament."
Mr Allawi's Sunni-backed Iraqiya coalition won the most seats in the March 7 parliament elections, but not a majority. That opened the door for Mr al-Maliki, whose State of Law party came in second, to cobble together alliances with religious Shiite parties, gathering enough seats to force Mr Allawi to make a deal, thwarting his bids for both the prime minister job and the presidency.
Instead, Mr Allawi will lead a newly created council to oversee issues of security and foreign policy. But the council's powers remain vague: Mr al-Maliki is unlikely to give up the reins over security issues, and one of his key Shiite partners - the staunchly anti-American Sadrist movement - also appears to be angling for a hand as well.