Iraq's prime minister appealed to the country's warring political factions for unity after formally accepting on Thursday a request by the president to form the next government, part of a deal to end an eight-month deadlock over who would lead the country the next four years.

The long-awaited request from President Jalal Talabani sets in motion a 30-day timeline to accomplish the daunting task of finding a team that includes all of Iraq's rival factions and will oversee the country during the departure of American troops.

"I know and you know well that the responsibility I am undertaking is not an easy task especially in the current circumstances that our country is passing through," al-Maliki said.

The new government is expected to include all the major factions, including the Kurds, Shiite political parties aligned with Iran and a Sunni-backed bloc that believes it should have been the one leading the next government.

Many of the politicians were in the room with al-Maliki and Talabani when the announcement was made in a show of unity that belies the country's often divisive politics.

Al-Maliki, a contentious figure in Iraqi politics who rose from obscurity to lead the government in 2006, called upon Iraqis and fellow politicians — many who view him with distrust and animosity — to support him in the task ahead.

"I call upon the great Iraqi people in all its sects, religions and ethnicities and I call upon my brothers the politicians to work to overcome all differences and to put these differences behind us," said the prime minister designate.

In an interview with The Associated Press, U.S. Ambassador to Iraq James F. Jeffrey said al-Maliki has "a long to-do list" over the next 30 days in selecting a broadly supported Cabinet that must be approved by a majority in parliament.

"He's in a strong position," Jeffery said. "But it isn't over until it's over, and it's essentially 325 members of the parliament that have the final say."

Both Jeffery and Gen. Lloyd Austin, top commander of U.S. forces in Iraq, said they expected democracy to prevail in Iraq despite doubt some may have about its survival.

"You will hear episodes of, witness episodes of people having doubt about the future in terms of democracy," Austin said. "By the same token, you'll witness a number of people who feel good about the prospects of democracy. It's what people want it will mature as time goes along."

Al-Maliki will have to find substantial roles for all of those factions or risk having them leave his government, a possibly destabilizing blow for Iraq's still fragile democracy that is struggling to overcome years of violence and economic sanctions.

The president's request Thursday was largely a formality, coming after Talabani was elected on Nov. 11 and at the time publicly asked al-Maliki to form the next government. Talabani then had 15 days in which to formally extend the offer, giving al-Maliki some extra time to work out the details.

The announcement underscores what has been a stunning comeback for al-Maliki, whose State of Law coalition came in second in the March 7 election to the Sunni-backed bloc led by former prime minister Ayad Allawi. But neither bloc gained the 163-seat majority necessary to govern, which translated into an intensive period of political jockeying.

As the political discussions dragged on, so did violence, raising concerns that insurgents were trying to exploit the political vacuum to bring about more sectarian warfare.

Allawi and his Iraqiya coalition were never able to gather enough support from Iraq's political parties, which are still defined largely by their sectarian allegiances.

Although Allawi himself is a Shiite, his largely Sunni coalition was viewed with suspicion by many in Iraq's political scene who still harbor deep resentment over the Sunni-dominant government that ruled Iraq under Saddam Hussein and worry about Sunnis returning to power.

That left al-Maliki, who in the end managed to pull together support from fellow Shiite political parties and the Kurds that propelled him toward a second term.

Under a power-sharing deal designed to include all the political factions, Iraqiya got the parliament speaker's post, the Kurds and Talabani were awarded the presidency and al-Maliki returned to the prime minister's office.

One of the most closely-watched developments will be what posts al-Maliki gives to Iraqiya. If the Sunni population believes it is blocked out of key posts and effectively kept from a meaningful role in government, it could risk a return to the sectarian violence that once ripped Iraq apart.

Allawi, who did not attend the meeting, was to be given the head of a still to be formed council that would have ambiguous powers over major government decisions.

But Allawi has not publicly accepted the post, which was pushed by the Americans as a way to include him in the government and serve as a check on al-Maliki's powers. Already there are conflicting opinions from al-Maliki and Allawi supporters over just how much power the council will have.

Al-Maliki will also have to weigh what role to give to followers of anti-American cleric Muqtada al-Sadr. The Shiite cleric's support for al-Maliki in early October was a result of pressure from neighboring Iran and is considered a key turning point in sending al-Maliki back to the prime minister's office.

But the Sadrists' anti-American stance, ties to Iran and their disturbing history as one of the major players in the country's sectarian violence, poses challenges about what cabinet posts to give them.

Al-Maliki asked the political blocs vying for top positions such as minister of oil and foreign affairs in the next government to put forward well-qualified candidates able to take on the tough challenges facing Iraq.

But ministry posts have in the past been a way to stack the government with supporters of various factions and in such an unwieldy government including all the rival groups, bureaucratic gridlock and indecision seems inevitable.


Associated Press writers Saad Abdul-Kadir in Baghdad and Lara Jakes at Camp Speicher, Iraq, contributed to this report.