Government forces agreed a truce on Tuesday with Shiite militia fighters after violent clashes south of Baghdad, as Iraq reeled from a three-day bout of bloodshed in cities across the country.
Since Saturday -- when Prime Minister Nuri al-Maliki hosted a peace conference for tribal leaders -- Iraq has been battered by firefights, bomb attacks and murders, marking one of the most violent periods in recent months.
Scores of Iraqi soldiers and civilians have been killed, along with 10 US soldiers, and government forces came close to losing control of the mainly Shiite city of Diwaniyah, 180 kms south of the capital.
A fuel pipeline exploded near the town on Tuesday, killing at least three civilians, as local authorities and Iraqi forces reached a deal with the Mahdi Army militia to halt a battle which had already left 20 soldiers dead.
Diwaniyah local council member Sheikh Ghanim Abid said: "We reached a settlement with Mahdi Army forces to end the confrontation."
According to Abid, the army agreed not to enter residential areas for three days, the Mahdi Army will withdraw armed fighters and a militia commander who was arrested at the weekend will be brought to court within 24 hours.
"We are now watching the militia withdrawing. They started pulling out early this morning and they're still going," an Iraqi army captain said.
Shops began to reopen in Diwaniyah on Tuesday and water and electricity supplies were turned back on, as a tense calm returned to the town.
On Monday, the battle saw militiamen take control of several districts.
Defence ministry spokesman Mohammed al-Askari said that 20 soldiers and 40 militiamen had been killed in the fighting.
Meanwhile, the head of Diwaniyah's health department, Hamid Taathi, said his hospitals had received the bodies of eight civilians and treated 61 bystanders for wounds received in the fighting.
Even as tentative peace returned to Diwaniyah, local councillor Ghanim Dahash said a blast on a fuel pipeline in Afak distict had killed three people living nearby and seriously injured about 25.
The pipeline carries petrol (gasoline) from Iraq's southern oil fields to the capital, and is often targeted by saboteurs who cut holes in the pipe and siphon off fuel, which is currently in short supply.
Suspected Sunni Muslim insurgents, meanwhile, killed two Shiite militiamen on Tuesday in an attack on the office of radical cleric Moqtada al-Sadr in the restive Iraqi city of Baquba north of Baghdad, police said.
The Diwaniyah clash underlined the growing confidence of Iraq's Shiite militia, some of which have been accused of involvement in sectarian killings of members the Sunni Arab minority.
Iraq's Shiite-led coalition government has so far been unable or unwilling to rein in the militias, which are linked to powerful figures in Maliki's coalition government.
The loosely-organised Mahdi Army militia, for example, is nominally loyal to Sadr and also has ministers in the government and a large parliamentary bloc.
The US military has sporadically clashed the militias, but has also faced resistance from Maliki himself, who has criticised night time raids on Baghdad's Sadr City, the bastion of Mahdi Army in the capital.
On Monday, US military spokesman Major General William Caldwell said that a joint US-Iraqi security operation would evetually be extended into Sadr City, a move that could provoke further clashes.
Baghdad itself suffered a deadly bout of violence in the past three days, with insurgents launching a series of car bomb attacks.
US military's losses in Iraq have increased to 2,629, according to an AFP count based on Pentagon figures, with the military reporting the deaths of 10 soldiers in the last three days.