BAGHDAD (AP) -- Iraq's main Shiite political bloc and supporters of firebrand cleric Muqtada al-Sadr signed a fragile cease-fire in Baghdad's Sadr City on Monday, hoping to end seven weeks of fighting that has left hundreds dead.
But the U.S. military has alleged that most Shiite extremists fighting Iraqi and U.S. forces in the teeming slum have splintered away from al-Sadr's Mahdi Army, and that the cleric's level of influence on those rogue groups is unclear. Many are thought to be trained and armed by Iranian forces. Iran denies the allegations.
Al-Sadr's representatives and the rival United Iraqi Alliance agreed to institute the four-day cease-fire starting on Sunday, but talks over the details of the truce were not finished until a day later. The deal allows Iraqi forces to take over security in the militia stronghold of Sadr City on Wednesday.
"The mutual efforts of all have stood against civil war, and thanks to God we have left it behind our backs," proclaimed Prime Minister Nouri al-Maliki, a Shiite.
The clashes erupted late March when Iraqi forces launched a crackdown in the southern city of Basra. The Sadrists accused al-Maliki, a political rival, of trying to sideline them ahead of expected provincial elections in the fall.
The fighting spread through the south and to the capital, where Shiite extremists in Sadr City began firing rockets and mortars toward the heavily fortified Green Zone.
Al-Sadr effectively stopped his militia from fighting in Basra within days of the crackdown. But clashes escalated in Sadr City, drawing U.S. attack aircraft and tanks into the fighting.
Al-Sadr recently threatened to launch an all-out war against U.S.-led forces but ordered his militia to avoid Iraqi casualties. His movement appears divided over whether to launch a full-scale fight against Americans or focus on political efforts.
The prime minister used the consensus that emerged from the cease-fire to seek a thaw in relations with the Sadrists.
"I thank all who responded to reason and the interests of country ignoring personal interests," al-Maliki said. "The government is targeting those who violate law and not targeting any political body."
Under the compromise deal, Iraqi forces will try to refrain from seeking American help to restore order. The U.S. military officials on Sunday said they were supporting the government forces and would take their lead.
The Sadrists, meanwhile, rejected calls by al-Maliki to surrender weapons but agreed to allow Iraqi security sweeps, saying Mahdi fighters have no "medium or heavy weapons."
"We have agreed on a cease-fire and to end displaying arms in public," said Sheik Salah al-Obeidi, an aide to al-Sadr. "But we did not agree on disbanding the Mahdi Army to hand over its weapons."
The Sadr movement is keen on keeping its 60,000-strong militia force intact.
The cease-fire comes as the U.S. military has largely finished the building of a barrier - reaching up to a height of 12 feet - to isolate extremists from using the southern section of Sadr City and to disrupt supply and escape routes for militants. The fighting was concentrated mostly in the southern part of the Shiite slum of about 2.5 million people.
Despite the cease-fire, the U.S. military said three militants were killed in Sadr City on Sunday and early Monday after attacking troops with rockets and small arms. Iraqi health officials said the latest clashes left two dead and 25 wounded. but it was unclear whether any gunmen were among them.
Associated Press writer Qassim Abdul-Zahra in Baghdad contributed to this report.