Updated

An aide to Iraq's top Shiite cleric Grand Ayatollah Ali Husseini al-Sistani (search) said Thursday that a peace deal was reached with rebel leader Muqtada al-Sadr (search). The deal ends three weeks of fighting in the holy city of Najaf.

The Iraqi government accepted the agreement brokered by Iraq's top Shiite cleric, according to State Minister Qassim Dawoud early Friday. The Iraqi government will not try to arrest al-Sadr, who was being sought for an alleged role in the slaying of a rival cleric last year, Dawoud said.

"Brothers, we have entered the door to peace," he said. He added that U.S. and coalition forces will pull out of Najaf as soon as interim Prime Minister Ayad Allawi (search) orders them to leave.

The five-point plan called for Najaf and Kufa to be declared weapons-free cities, for all foreign forces to withdraw from Najaf, for police to be in charge of security, for the government to compensate those harmed by the fighting and for a census to be taken to prepare for elections expected in the country by January.

There was no immediate word if the U.S. military would accept the provisions on the agreement calling on its forces to leave Najaf.

Top al-Sistani aide Hamed Al-Khafaf announced al-Sadr's acceptance and suggested fighters from his Mahdi Army militia would leave the Imam Ali Shrine, the holy site they have used as a stronghold and refuge throughout the fighting.

"Mr. Muqtada al-Sadr agreed to the initiative of his eminence al-Sistani," said al-Khafaf. "You will hear good news soon from the government and Mr. Muqtada al-Sadr. ... It's the same initiative that we had proposed ... almost the same initiative has been agreed upon."

"There will be a mechanism that will preserve the dignity of everyone in getting out of the holy shrine, and you'll see this in the coming hours," al-Khafaf told Al-Jazeera television.

The shrine, in Najaf's Old City, has been the center of fighting, and U.S. troops have tried to avoid damaging it, fearing it would anger Shiites.

Iraqi police characterized the peace plan as "very positive," Reuters reported. Al-Sistani and al-Sadr, or at least aides to the two leaders, had been meeting all day Thursday.

The agreement came on the heels of news that 100 people had died — 27 in a mortar attack on a mosque — in the troubled cities of Kufa and Najaf during the past 24 hours, according to Iraqi officials.

The mosque attack in Kufa also wounded 63 on Thursday and came just hours before al-Sistani, 75, arrived in neighboring Najaf in an attempt to end the bloody fighting.

A 24-hour cease-fire, called for by Allawi, technically took effect in Najaf as al-Sistani held talks with firebrand cleric al-Sadr, whose militia had been holding U.S. and Iraqi forces at bay for weeks.

The U.S. military ordered an operational pause in Najaf to honor the cease-fire.

Along with the mortar attack, another group of thousands of marchers heading into Najaf from its sister-city Kufa came under fire from an Iraqi National Guard (search) base. At least three people were killed and 46 wounded.

Including those attacks, around 95 people were killed in Kufa and Najaf in 24 hours, the Health Ministry reported.

The intervention by al-Sistani — the most widely respected cleric among Iraq's Shiite majority —had been the best hope so far to end the fighting between U.S.-Iraqi forces and the Mahdi Army (search) militia of the radical al-Sadr.

Al-Sistani arrived in a 30-vehicle convoy that drove in from Basra, cheered by thousands of supporters in towns along the way.

Urged by al-Sistani's aides to march for peace, thousands more came from their hometowns to Najaf and gathered on its outskirts, but witnesses said police barred them from entering the city.

"The presence of his eminence al-Sistani will solve the crisis because he promised he would negotiate with the government and will persuade the Sadrist movement to reach ... a solution that will save (their) dignity," said Al-Sadr aide Ahmed al-Shaibany before the deal was made. "I'm optimistic."

Upon al-Sistani's arrival in Najaf, the heavy clashes there appeared to ease, though gunfire still echoed sporadically throughout the city. Several hundred yards away from the house where al-Sistani was staying, Shiite militiamen and Iraqi security forces exchanged fire, and at least three people were wounded.

Hours later, gun battles and an explosion could be heard again in the Old City.

With all sides — the Americans, the Iraqi government and al-Sadr — giving at least nominal support to al-Sistani's efforts, it was not known who fired the mortars that struck the mosque in Kufa or whether it was an attempt to sabotage the peace effort. Iraqi police have shot at peaceful marchers several times in the past few days.

Also on Thursday, a patrol of U.S. Marines found a building filled with rocket-propelled grenades, machine guns, AK-47s, improvised explosive devices that were already built, night-vision equipment, body armor and a stockpile of mortars. The building is located about 10 meters from the facility the FOX News crew is living in.

Deadly Days of Fighting

The fighting here has killed scores of civilians and nearly paralyzed the city since it began Aug. 5. In the last 24 hours, 55 people were killed and 376 injured during clashes in Najaf, Sa'ad al-Amili of the Health Ministry said Thursday. At least 40 people have been killed in Kufa over the same period, including the victims in the mosque.

The military said Thursday that a U.S. soldier in Baghdad was killed by a mortar attack the night before. As of Wednesday, 964 U.S. service members have died since the beginning of military operations in Iraq in March 2003, according to the U.S. Defense Department.

Al-Sistani — who had been in London undergoing medical treatment — has refused to get involved in previous crises and has stayed above the fray, supporting neither al-Sadr nor the U.S. troops and the pro-U.S. government.

He holds the loyalty of a far broader swath of Iraq's Shiite majority than al-Sadr. Al-Sadr's fiery anti-U.S. message has drawn many poorer, disillusioned Shiites but is seen by other Shiites as too radical.

Al-Sadr's followers have set up their own religious courts and arrested hundreds of people on charges including selling alcohol and music deemed immoral.

Al-Sistani's 30-vehicle convoy drove 220 miles from the southern city of Basra to Najaf, joined by at least a thousand cars from towns along the way, where supporters on the street cheered al-Sistani.

A close al-Sadr aide said the militants would listen to al-Sistani's peace plan. "We will listen to him and we hope to see the government listen to him as well," said Yusif al-Nasiri. "They should listen and obey what he is going to say."

Al-Sadr's aides had backed al-Sistani's call for a march on Najaf and urged their followers to join in.

Thousands of Shiites had gathered at the mosque in Kufa, an al-Sadr stronghold, to march to Najaf when the mortar rounds hit — one inside the mosque compound and around two others at the main gate, according to witnesses.

"This is a criminal act. We just wanted to launch a peaceful demonstration," said Hani Hashem, bringing an injured friend to the hospital.

Blood was splattered on the pavement in a courtyard beside the mosque and a pair of sandals was left nearby, according to Associated Press Television News footage. Shrapnel from the explosions tore small chunks out of walls and the pavement, but the compound did not appear to have suffered serious structural damage.

Outside the hospital's gate, crowds of angry people gathered, shouting, "God is great!"

After the attack, thousands of demonstrators loyal to al-Sadr marched on nearby Najaf but came under fire from a base between the two cities housing Iraqi national guardsmen and U.S. troops, witnesses said.

The marchers scattered when the gunfire broke out. The day before, gunfire from the same base killed eight people and wounded 56 others who were taking part in what appeared to be a peaceful demonstration supporting al-Sadr.

Another mortar attack in Kufa on Wednesday, apparently targeting a police checkpoint, killed two civilians, including an 8-year-old boy.

Al-Sadr aide Hussam al-Husseini blamed the mortar attack on American forces backing Iraqi troops in the city. "We held the interim government responsible for this bombing," he said.

A U.S. military spokesman, Marine Capt. Carrie Batson, denied the Americans fired the barrage, saying troops were still avoiding targeting holy sites in Kufa and Najaf.

One U.S. military official, speaking on condition of anonymity, said it was possible that rebels firing at nearby Iraqi National Guard positions overshot their target and hit the mosque.

Any damage inflicted by U.S. forces on holy sites would anger Iraq's Shiite majority and could spark a greater uprising against the fledgling interim government, which is also battling a persistent and bloody Sunni insurgency.

In other violence, saboteurs attacked about 20 oil pipelines in southern Iraq late Wednesday, reducing exports from the key oil producing region by at least one third, an official with the state-run South Oil Co. (search) said Thursday on condition of anonymity.

FOX News' Catherine Donaldson-Evans, Caroline Shively and The Associated Press contributed to this report.