BAGHDAD — Representatives of firebrand cleric Muqtada al-Sadr and lawmakers from Iraq's main Shiite political bloc signed a four-day cease-fire Monday in an effort to end seven weeks of fighting in Baghdad's Sadr City slum.

It was unclear if the agreement would be respected by all the extremists who have been fighting in Sadr City. Al-Sadr is thought to have influence over some of the militants, but not all of them. Many of those fighting Iraqi and U.S. forces are thought to have splintered away from al-Sadr's Mahdi Army.

The U.S. military has repeatedly said its clashes are with rogue elements of al-Sadr's militia and that the majority of the 60,000-strong Mahdi Army did not openly participate in the fighting, adhering to a general cease-fire ordered last August by al-Sadr.

The fighting was concentrated mostly in the southern part of the Shiite slum that is home to about 2.5 million people, and Iraqi officials have reported that hundreds of people have died in the fighting.

Clashes began in late March after militants responded to a crackdown by Iraqi troops in Sadr City by firing hundreds of mortars and rockets at the heavily fortified Green Zone housing the government and Western embassies.

"We have signed the agreement today," said Khalid al-Attiyah, the deputy parliamentary speaker from the main Shiite political bloc, United Iraqi Alliance.

Al-Attiyah said the cease-fire went into effect on Sunday and Iraqi forces will be allowed to enter the area as early as Wednesday and "take over the security there."

The statement said "the government will decide on the number of Iraqi forces to be deployed in Sadr City to achieve security, in order to refrain from asking help from foreign forces," a reference to the U.S. military.

"Any attack against residential areas, government offices and the Green Zone are prohibited from Sadr City or from another area," the agreement said.

The cease-fire stipulates that Iraqi forces have the right to "impose the law and to pursue illegal situations."

"No one and no side has the right to interfere in the work of these forces," it said, adding that the government retained the right to pursue "those who carried out armed attacks against the government."

Sheik Salah al-Obeidi, an aide to al-Sadr, stressed that the Sadrists rejected conditions set by Prime Minister Nouri al-Maliki to disband the Mahdi Army and hand over their weapons.

"We have agreed on cease-fire and to end displaying arms in public," al-Obeidi said. "But we did not agree on disbanding the Mahdi Army to hand over its weapons.

Al-Obeidi showed a document signed by al-Sadr to an Associated Press reporter that authorized the delegation to sign the cease-fire agreement.

The Sadrist movement said that they do not have any "medium or heavy weapons and that the government forces were free to raid and search any suspected place."

The agreement also allowed the government to clear Sadr City of roadside bombs. It said another entrance to Sadr City will be opened and that government will be allowed to reopen their offices.

The agreement also called on both sides to refrain from using media outlets to provoke tensions. It said al-Maliki will supervise a committee which will monitor any violations.

Associated Press writers Bushra Juhi and Selcan Hacaoglu contributed to this report from Baghdad.