The Shiite hard-liner tapped as Iraq's new prime minister promised Saturday to swiftly finish building a unity government after parliament elected a top national leadership, ending months of political deadlock as the nation spiraled into chaos.

Jawad al-Maliki has 30 days to assemble a Cabinet from divided Shiite, Sunni and Kurdish parties. The most contentious question will be filling key ministries that control security forces amid demands to purge them of militias blamed for the rise in sectarian bloodshed.

Five American soldiers died Saturday in roadside bombings south of Baghdad, and Marines killed four insurgents in a gunbattle in Ramadi — clear signs of the ongoing security crisis.

After repeated delays, parliament convened Saturday in the heavily guarded Green Zone and elected a president, two vice presidents, a parliament speaker and two deputies.

President Jalal Talabani, a Kurd who won a second term, named al-Maliki as prime minister-designate, a formality after the dominant Shiite bloc replaced outgoing Prime Minister Ibrahim al-Jaafari. Sunnis and Kurds refused to accept al-Jaafari.

That laid the foundation for post-Saddam Hussein Iraq's first fully constitutional government, which Washington hopes can quell the Sunni-led insurgency and bloody Shiite-Sunni violence. That would enable the United States to begin withdrawing its 133,000 troops.

Few believe the task will be easy. It remains uncertain whether Iraqi leaders representing religiously and ethnically based parties can set aside their interests and rise to the challenge of managing a nation perched at the brink of disaster.

President Bush welcomed suggested the new Iraqi government could be the beginning of an eventual drawdown of American forces from Iraq.

"The new Iraqi government will assume greater responsibility for their nation's security," he told reporters during a trip to California. "It will have the popular mandate to address Iraq's toughest long-term challenges," he added.

"This historic achievement by determined Iraqis will make America more secure," Bush said.

U.S. Ambassador Zalmay Khalilzad, a key player in tortuous political negotiations since Dec. 15 elections, told reporters improvement will not be instantaneous.

"I think that with the formation of a national unity government with a good program and with competent ministers, Iraq will be on the right trajectory," he said.

The tough-talking al-Maliki, who once managed Shiite guerrillas in Saddam's Iraq from exile in Syria, promised an inclusive government with "all components of Iraqi society."

Al-Maliki, 55, also signaled he was prepared to crack down on Sunni insurgents and Shiite militias responsible for the rise in sectarian violence that threatens to plunge the nation into civil war.

"Weapons should be only the hands of the government," al-Maliki told reporters. He pointed to laws requiring militias to be integrated into the nation's security forces.

Al-Maliki's toughest task will be assigning control of the defense and interior ministries, responsible for the army and the police. Sunnis have accused the Shiite-run Interior Ministry of tolerating death squads that target Sunni civilians. Army and police ranks are believed to be infiltrated by militias.

The current interior minister belongs to the largest Shiite party, the Supreme Council for the Islamic Revolution in Iraq, believed to operate a militia. U.S. officials have insisted the next minister have no ties to militias.

Another militia, the Mahdi Army, is controlled by radical anti-American cleric Muqtada al-Sadr, who supported al-Jaafari for another term. Al-Sadr refuses to disband his force unless other militias are abolished and the army and police prove capable of protecting Shiites from Sunni extremists.

While politicians from all sides called for unity and an end to sectarianism in Saturday's parliament session, the differences were visible.

The new Sunni parliament speaker, Mahmoud al-Mashhadani, insisted the armed forces must be built "on the basis of national loyalty" and spoke strongly against sectarian violence — code among Sunnis for militia violence.

Then a lawmaker stood and chided him for not speaking out against terrorism — a reference to the Sunni-led insurgency.

Al-Jaafari took the podium and barked, "Your only enemy is terrorism. That is all."

In his new role, Al-Maliki must make overtures to the disaffected Sunni Arab community, the backbone of the insurgency. Sunni Arab politicians accepted al-Maliki despite his reputation as a hardline champion of Shiite rights.

Al-Maliki was deputy chairman of a committee formed to purge Saddam allies from political life. Many Sunnis believed the committee's goal was to deny them a role in Iraq.

He also was a tough negotiator in deliberations over Iraq's new constitution, passed last year despite Sunni Arab objections. He resisted U.S. efforts to put more Sunnis on the drafting committee as well as Sunni efforts to dilute provisions giving Shiites and Kurds the power to form semiautonomous mini-states in the north and south.

Under a deal worked out with Sunnis last year, parliament has four months to consider constitutional amendments, a process likely to strain relations among the ethnic and religious groups at a time when the Americans are pushing for unity.

In a sign of the security challenge, suspected insurgents exploded two bombs Saturday in a market in Muqdadiyah, about 60 miles northeast of Baghdad, killing at least two Iraqis and wounding 17. The second blast was timed to hit emergency crews arriving at the scene.

The bullet-ridden bodies of 10 Iraqis were found in and around Baghdad, many blindfolded with hands and legs bound in rope. Some appeared to have been tortured, and one was decapitated, police said.

Police also found a body with signs of torture floating in the Tigris River in Kut, 100 miles southeast of Baghdad.

In the capital, gunmen in a speeding car sprayed a police patrol with machine-gun fire, killing one officer. Gunmen killed a civilian riding in a car, and a roadside bomb wounded two policemen.