Calm returned to a southern city Tuesday after a deal between Shiite militiamen loyal to a powerful cleric and Iraqi government forces ended a fierce 12-hour street battle that killed 40 people.

In the capital, Iraqi police found the bodies of 24 people who had apparently been tortured and shot before being dumped in two locations in Baghdad, police said.

Eleven bullet-riddled corpses, with their hands and legs bound, were found near a school in the Shiite dominated Maalif neighborhood in southern Baghdad, police said.

The bodies of another 13 people, believed to have been aged between 25 and 35, were found dumped behind a Shiite mosque in the Turath neighborhood in western Baghdad. All were all handcuffed, showed signs of torture and had been shot in the head, said police 1st Lt. Maitham Abdul-Razaq.

Meanwhile, U.S. Attorney General Alberto Gonzales, a key architect of U.S. policy on the treatment of prisoners and the rule of law in Iraq, arrived in Baghdad for a one-day visit on Tuesday.

CountryWatch: Iraq

Gonzales, who has been criticized in the past for his position on the treatment of non-American prisoners held outside the United States, was to meet Deputy Prime Minister Barham Saleh and visit the Iraqi High Tribunal. The tribunal is currently trying former leader Saddam Hussein and six other defendants on charges of war crimes and crimes against humanity.

In Monday's fighting in Diwaniyah, 80 miles south of Baghdad, at least 25 Iraqi soldiers, 10 civilians and five militiamen were killed and 75 people were wounded in some of the worst fighting seen in recent months between the Iraqi army and Shiite militiamen loyal to firebrand anti-U.S. cleric Muqtada al-Sadr.

"Life is back to normal, the shops are open and Iraqi police and soldiers are deployed everywhere in Diwaniyah," said police Lt. Raid Jabir, contacted by telephone.

Leaders of the tribes to which the dead combatants belonged held reconciliation talks Tuesday to prevent retaliatory attacks, Jabir said.

Coalition helicopters were flying over the area on Tuesday, said Sheik Abdul-Razq al-Nidawi al-Sadr representative in Diwaniyah.

"It is calm and there are no clashes but we notice an intensive fan out of the ... helicopters above the areas where the clashes were erupted," he said.

Abbas Gahat, a grocer in Diwaniyah reached by telephone, said all shops were open in the city, despite some having suffered damage. "Life is back to normal as if nothing took place," he said.

Jabir, the police lieutenant, said the police and Iraqi army had deployed throughout the city and the militiamen had withdrawn from all the areas they had seized.

The violence ended Monday afternoon after the provincial governor, accompanied by eight provincial council members, traveled to the holy city of Najaf, west of Diwaniyah, to meet with al-Sadr.

Officials said an agreement was reached by both parties to restore security to the province. But the exact details of the deal were unclear.

Al-Sadr's influence has gradually been increasing in Shiite-dominated Diwaniyah,

He is already popular in large parts of southern Iraq, particularly in Najaf and the surrounding area. He also wields considerable influence in some areas of Baghdad, especially in the slum of Sadr City.

Although Diwaniyah's streets were quiet Monday, an explosion at an oil pipeline south of the city left at least 27 people dead.

Jabir of the city's police said 34 people had been killed and another 45 injured. But Khalil Jalil Hamza, the governor of Diwaniyah said the death toll was inflated. He said 27 people had been killed and 15 other injured. It was not immediately possible to reconcile the two accounts.

A huge fire in the area was hampering rescue efforts, Jabir said.

The cause of the blast was unclear, but locals had been siphoning off fuel from the pipeline for years, he said.

There was trouble, however, in the town of Baqouba, 60 kilometers (35 miles) northeast of Baghdad. Three mortars, two rocket propelled grenades and a bomb exploded at an al-Sadr office almost simultaneously, killing two guards and destroying the building, the Diyala Province police in the city said. Baqouba is ethnically mixed but with a majority of Sunnis.

It was not immediately clear whether there was any connection to the fighting in Diwaniyah.

Monday's violence there underlined the Shiite-led Iraqi government's difficulties in reining in the violent sectarian forces of the Mahdi Army, which had twice confronted U.S. forces in 2004, and Sunni forces opposed to it.

Al-Sadr's movement holds 30 of the 275 seats in parliament and five Cabinet posts, and the cleric's backing had helped Prime Minister Nouri al-Maliki win the top job earlier this year.

Many Sunnis have expressed disappointment that al-Maliki has not moved to curb Shiite militias, especially the Mahdi Army.

American forces also have been wary of confronting the militia because of al-Sadr's influence over the government and the Shiites, who are in a majority in Iraq.

In Iraq's second-largest city of Basra, about 100 prison guards demonstrated to protest plans to hand over control of a prison from British forces to Iraqi authorities, police said. The demonstrators were calling for the handover to be delayed, saying there was rivalry between several groups that wanted to run the prison.

Meanwhile, the U.S. military said Tuesday that nine U.S. soldiers were killed on Sunday, eight of them in and around Baghdad and one in fighting in Anbar province west of Baghdad. A 10th soldier died Monday of wounds sustained in a vehicle accident in Balad north of Baghdad.