U.S. forces, using tanks, armored personnel carriers and attack helicopters, pushed into the centers of two holy cities Wednesday in pursuit of bands of masked guerrillas loyal to a rebellious cleric at the heart of the Shiite insurgency.

In Karbala, U.S.-led forces worked with Iraqi police officers to seize a suspected weapons stockpile of the Mahdi Army, the militia loyal to Moqtada Sadr, a 31-year-old Shiite cleric who has emerged as a chief nemesis of the U.S. occupation. Troops came under rifle and mortar fire before dawn, U.S. officials said, setting off day-long street battles involving tanks, Bradley Fighting Vehicles and helicopters.

After dark, in the city of Najaf farther south, U.S. forces attacked militia positions not far from the shrine of Ali, one of Shiite Islam's most sacred mosques. Insurgents took refuge in Najaf's vast and sand-covered cemetery, the most coveted burial site for Shiite Muslims. U.S. officials said the fighters hid behind tombs and staged rocket-propelled grenade and mortar attacks from the sanctuary.

The combat marked an escalation in the U.S. drive to put down the Sadr rebellion, which has swept across southern Iraq and parts of the capital that had welcomed the U.S. invasion that ousted President Saddam Hussein last year. The Mahdi Army has employed guerrilla tactics and has used sensitive holy sites as cover from U.S. attacks.

The strategy has complicated the U.S. effort to contain the Shiite insurgency before handing over limited authority to an interim Iraqi government on June 30. U.S. officials claim the insurgency enjoys little popular support apart from the forces loyal to Sadr, which number in the thousands.

During the morning raid in Karbala, 60 miles south of Baghdad, U.S. military officials said troops discovered rocket-propelled grenade launchers, mortar rounds and explosive devices for roadside bombings inside a warehouse complex and in the neighboring Mukhaiyam Mosque.

The site is roughly 500 yards from the shrines of Hussein and Abbas, second only to the Najaf mosque in terms of religious importance to Shiites. Twenty-two insurgents were killed in the day-long fighting and six U.S. soldiers were wounded, U.S. officials said. They said troops were proceeding with caution inside the city's alleyways and narrow streets to avoid damaging the holy sites.

Witnesses said Sadr militants tried to storm the shrines early in the afternoon but were repelled by armed guards inside the mosques and U.S. Army snipers positioned on rooftops nearby.

"They allowed no one inside" the mosques, said Saad Hussein, 26, who works in a grocery store. "There was shooting back and forth between both sides, but they succeeded in keeping them out."

In the Baghdad slum of Sadr City, U.S. troops clashed in the morning with fighters loyal to Sadr who wielded rocket-propelled grenade launchers. U.S. officials said six insurgents were killed in the sprawling slum, which is named for Sadr's father, Grand Ayatollah Mohammed Sadiq Sadr, who was assassinated by suspected agents of Hussein's government in 1999.

In central Iraq, a series of hit-and-run attacks targeted U.S. military installations and those cooperating with the U.S. occupation. A mortar attack on a U.S. Army base near Balad killed four Filipino contractors, while in Baqubah, a bomb exploded outside the house of an officer with the U.S.-trained Iraqi police force. The explosion killed three members of his family. In the city of Samarra, also inside the area known as the Sunni Triangle, 20 armed men attacked the police station, drove off the officers inside and bombed the building, witnesses said.

[The military on Thursday reported that one U.S. soldier was killed and another was injured on Wednesday when a bomb exploded beside their convoy in Baghdad, the Associated Press reported.]

Reaction to the disclosures of torture in Abu Ghraib prison continued to complicate the U.S. effort to calm the country. At a news conference in Najaf, Sadr used the scandal as a rallying cry, calling on the American public to "pay attention to what your army is committing against our detainees."

As part of a step-by-step campaign to apply pressure on Sadr, U.S. commanders have avoided full-scale assaults on Kufa, which abuts Najaf, and especially on Najaf itself, the site of two major Shiite shrines. Instead, the commanders are trying to weaken Sadr's militia and isolate him, while pressing Shiite leaders to resolve the standoff.

"I appeal to the fighters and mujaheddin in Karbala to stand together so that none of our shrines and holy sites are defiled," said Sadr, who compared his fight to the guerrilla resistance in the Vietnam War.

But amid the fighting, there were tentative signs of progress in negotiations aimed at easing the military standoff in the Shiite south. Shiite political leaders said Grand Ayatollah Ali Sistani, Iraq's supreme Shiite spiritual leader who is based in Najaf, endorsed an agreement Wednesday that would disarm Sadr's militia and recognize it as a legitimate political party.

The agreement calls for Iraqi police to assume security responsibilities in Najaf and for disarming the Mahdi Army. U.S. forces would withdraw under the agreement, and a special Iraqi court would be established to try those accused of crimes committed since Sadr's arrival. The deal also calls for all "political prisoners" to be released from the U.S.-run detention system, a fresh demand in the wake of the prisoner-abuse scandal.

"We asked Sistani, and he approved of the disarmament of the army and turning it into a political or humanitarian organization," said Abdul Karim Anizzi , the representative of the Shiite Dawa party in Najaf, who attended the meeting.

U.S. officials reacted skeptically to the agreement.

"There are people talking to people around Sadr, but it is not clear whether those people are speaking for him," said a senior U.S. official familiar with the talks. "His room for maneuver is being compressed, but we have no indication that he is prepared for anything other than a forceful solution."

Sadr has been hunkered down in Najaf for more than a month. U.S. forces charge him with the April 2003 murder of the rival moderate cleric, Abdul Majid Khoei, who was stabbed to death on his return from exile in Britain. The agreement that emerged Wednesday does not specifically address Sadr's legal status.

Shiites involved in the negotiations say they expect the United States to delay any action on the arrest of Sadr until after the planned handover. Dan Senor, the chief spokesman for the U.S. occupation authority, said that any viable agreement must require Sadr to "submit to Iraqi justice."

The Najaf agreement resembles one reached this month that ended the U.S. military siege of Fallujah. U.S. Marine officers turned to a group of former Iraqi military officers to defuse an insurrection in the Sunni Muslim city west of Baghdad. The deal angered many Shiites, who account for 60 percent of the Iraqi population and suffered most under Hussein.

In recent days, U.S. military officials have said that Mahdi Army members could be tapped for a local Najaf security force if an agreement could be reached with Sadr to disarm. Sadr's aides said they were waiting for Sistani's endorsement in writing before moving ahead.

"Dissolving the Mahdi Army is in the hands of the Marjiya," Sadr said, referring to a council of Shiite clerics led by Sistani. "If the Marjiya ask me to do that, I will do it."

In Karbala, a shroud of black smoke hovered above the gold dome of the shrine of Hussein, named for the grandson of the prophet Muhammad martyred near Karbala in 680. Witnesses said fighting between insurgents and U.S. troops, members of the 1st Armored Division, ignited a row of shops.

The roads into Karbala were either blocked by U.S. and Iraqi security forces or lined with troops of the U.S.-trained Iraqi Civil Defense Corps, which checked cars entering the area. Inside the city, U.S. Army snipers and Iraqi police took up positions on the roofs of three- and four-story buildings.

Witnesses said Mahdi Army fighters occupied many nearby buildings and tried to take over hotels at strategic locations around the city. Owners and their armed helpers drove them off. U.S. soldiers would not allow anyone to approach the shrines. Witnesses said several civilians were killed by gunfire near the shrine, including some coming to pray.

"I don't think they will last very long," said Imad Ibrahim, 23, who sells sweets. "No one is giving them food. We're afraid the American Army will stop this operation before finishing them. We've suffered for a week, and we can make it two or three more days."

There was one respite from the violence, although even it was initially mistaken for an attack. The Iraqi national soccer team defeated Saudi Arabia, 3-1, on Wednesday to qualify for the Olympics for the first time. The clatter of celebratory gunfire in Baghdad, sending red tracer bullets arcing into the night sky, initially alarmed many U.S. soldiers more accustomed to shots fired in anger.

Correspondent Rajiv Chandrasekaran in Baghdad and special correspondents Saad Sarhan in Najaf and Naseer Nouri in Karbala contributed to this report.

An Iraqi shouts anti-U.S. slogans during a funeral for two members of the Mahdi Army, a militia now at the heart of a Shiite insurgency in southern Iraq.Radical Shiite cleric Moqtada Sadr arrives at his news conference in Najaf, where he used the scandal at Abu Ghraib prison as a rallying cry.