BAGHDAD, Iraq (CNN) -- The Iraqi government and Shiite cleric Muqtada al-Sadr's movement have agreed to a cease-fire to end weeks of fighting in Baghdad's Sadr City district, spokesmen for both sides said Saturday.
Iraqi children look at burned-out cars Saturday in Baghdad's Sadr City neighborhood.
The 14-point agreement will "impose the state's authority and security ... in Sadr City," Iraqi government spokesman Ali al-Dabbagh said.
It will end the militias' armed presence in the sprawling eastern Baghdad slum, he said, and clear the district of roadside bombs and mines.
Sheikh Salah al-Obeidi, an al-Sadr spokesman, said the cease-fire will go into effect no later than Sunday morning.
U.S. Military Col. Gerald O'Hara welcomed the agreement.
"As we have always indicated, we support political solutions in Sadr City as well all of Iraq." O'Hara said. "We would welcome an end to violence by the criminal elements who continue to endanger the lives of innocent Iraqi citizens."
Iraqi and U.S. forces have battled Shiite militants in Sadr City since the end of March. About 1,000 militants and civilians have been killed, and more than 2,000 have been wounded.
Negotiations between the Iraqi government and followers of al-Sadr's movement began about two days ago, al-Obeidi said. He said the talks were mediated by the United Iraq Alliance, the ruling Shiite political bloc, of which Prime Minister Nuri al-Maliki is a member.
After the cease-fire, the government will reopen all entrances to Sadr City, allowing aid to flow in and the wounded to be evacuated, al-Obeidi said. Access to the district has been limited during the military operations, and there are shortages of water, food and medical supplies there, according to the United Nations Children's Fund.
Iraqi security forces will maintain checkpoints at the entrances of Sadr City to prevent infiltration, government spokesman al-Dabbagh said.
Iraqi forces will also be on the district's streets, conducting searches and raids to detain wanted individuals, according to al-Obeidi, and he warned that according to the agreement, the government will punish the security forces if they violate residents' rights in the process.
Al-Dabbagh would not say whether there would be a permanent presence of Iraqi forces in the Shiite slum and said only that governments have the right to impose authority and rule.
It remained unclear who would abide by the cease-fire. Not all Shiite militants involved in the Sadr City fighting are members of al Sadr's Mehdi Army, although many are. The U.S. military has said that the Shiite militias fighting in Sadr City are "special groups," or Iranian-backed cells who have not obeyed al-Sadr's freeze of Mehdi Army military activities.
Al-Sadr put the freeze in place in August and renewed it in February.
On Saturday, the Mehdi Army distributed among its members a statement telling "the "brothers in the Mehdi Army" to hold their positions until they receive another statement from the Mehdi command.
"Be aware that the enemy's propaganda controls all channels and satellites and in one way or another they are trying to affect our determination and morale," it said.
In northern Iraq, government forces backed by U.S. troops have begun an offensive against al Qaeda in Iraq in the province of Nineveh, the commander of military operations for the province said Saturday.
The operation includes at least 3,000 Iraqi police, 1,000 Iraqi special forces and 10,000 Iraqi soldiers backed by U.S. troops, according to Nineveh Deputy Gov. Khasro Goran.
Iraqi and U.S. troops have stepped up operations in recent months against al Qaeda in Iraq in Nineveh's provincial capital of Mosul, a predominantly Sunni city and one of Iraq's most dangerous.
Al-Maliki, who has been focused lately on the troubles in the Shiite regions of Iraq, deployed more Iraqi troops to Mosul and the surrounding province earlier this year. He had promised an offensive to root out the insurgency there.
On Thursday, Iraqi officials announced they had captured the leader of al Qaeda in Iraq during a raid in Mosul, but the U.S. military said the Iraqis were mistaken.
Iraqi officials imposed an indefinite ban, beginning Friday night, on all pedestrian and vehicular traffic in Mosul.
In the southern city of Basra, a roadside bomb exploded Saturday, killing two civilians and wounding five others, a police official said.
In southeastern Baghdad's Zafaraniya district, a roadside bomb exploded at about 7 a.m., wounding five people, including three police officers, according to the Interior Ministry.
In Husseiniya, about six miles north of Baghdad, a roadside bomb exploded near an Iraqi army patrol and wounded four Iraqi soldiers, the Interior Ministry said.
A U.S. soldier was killed Saturday when his vehicle rolled, the military said. The non-combat incident, which is under investigation, happened in al Asad in Anbar province. The soldier's name is not being released until his family has been notified, the military said
CNN's Mohammed Tawfeeq and Jomana Karadsheh contributed to this story.