A man sells shrouds used at the Shiite holy Imam Ali Shrine in Najaf, Iraq on Thursday, July 17, 2014. Najaf is home to several Iranian backed militias that are now vying for influence amid the insurgency and political turbulence in Iraq. (Max Becherer/Polaris Images for The Post)

Iranian-trained Shiite militias that accounted for a significant portion of U.S. combat deaths during the Iraq war are now at the leading edge of the Shiite-led Iraqi government’s battle to repel the Sunni militants who seized a vast arc of Iraqi territory last month.

The militias, which experts and U.S. officials say are also funded by Iran, are working closely with Iraqi forces in the field and coordinating with army commanders on strategy in the fight against the Islamic State , militia fighters, tribal leaders and government officials said in interviews.

“It is like any army, in that there are divisions inside it . . . and each one has its specialties,” Qais al-Khazali, leader of the League of the Righteous militia, said in a rare interview at his office in the Shiite holy city of Najaf.

But the presence of fighters who were implicated in the deaths of hundreds of U.S. troops and Sunni civilians several years ago underscores the growing potential that Iraq’s crisis could spiral into another devastating sectarian war.

The militias’ prominent role also suggests that despite having dispatched some 300 American military advisers to Iraq, the United States is wielding little influence here on the ground.

Photographs, plastic flowers and Korans grace the graves of fighters of the League of the Righteous, a Shiite Muslim Militia of the Asaib Ahl Al-Haq in the Valley of Peace cemetery next to the Imam Ali Shrine in Najaf, Iraq. (Max Becherer/Max Becherer/Polaris Images For The Washington Post)

On Friday, the United Nations said both sides in the conflict — including the Islamic State and associated groups, as well as the Iraqi armed forces and militias — have committed rights violations over the past month that may amount to war crimes.

At least 1,531 civilians were killed and 1,763 were wounded in June, the world body said.

Both sides, it said in its report, had carried out summary executions and other extrajudicial killings.

On the battlefield, Khazali said, all fighters wear Iraqi military uniforms, making troops and militiamen almost indistinguishable to civilians. But their operations differ, he added. “The military has the artillery and aerial force. We have the fighters who go down on the ground and purge the areas.”

Government officials confirmed the level of cooperation, although a few claimed that the militias had been incorporated into the military’s efforts as “individuals” rather than groups.

The Pentagon and the U.S. Embassy in Baghdad did not respond to requests for comment on the issue.

Key figures such as Khazali, from the League of the Righteous, and Hakim al-Zamili, from a militia formerly known as the Mahdi Army, were jailed on terrorism charges during the U.S. occupation but were later released by Iraqi Prime Minister Nouri al-Maliki’s government.

How the Islamic State is carving out a new country

Less than three years after U.S. forces departed, these men and their factions appear emboldened by Iraq’s newest conflict.

Khazali said that in addition to plotting strategy side by side with army commanders, the League of the Righteous is also helping to train volunteers.

Zamili, a lawmaker from radical Shiite cleric Moqtada al-Sadr’s bloc, said that in recent weeks he has acted as “general coordinator” for Sadr’s ”peace brigades” militia, the former Mahdi Army, which has taken control of the religiously mixed city of Samarra, once a flash point for sectarian violence.

In 2007, as sectarian killings racked the nation, U.S. forces arrested Zamili, who was then deputy health minister, on charges that he used American funds, Health Ministry employees and government ambulances to run death squads targeting Sunnis.

An Iraqi court acquitted Zamili a year later. And these days he serves as a member of the security and defense committee in Iraq’s parliament, where the League of the Righteous also holds seats.

Another Shiite militia, the Badr Brigade, is under the control of Iraq’s current transport minister.

On the front lines

Militia leaders justify their presence on the front lines by arguing that the army is too weak to go it alone.

“The Iraqi army kicks down doors, and the house turns out to be booby-trapped — it explodes and 30 people get killed,” said one high-ranking League member who spoke on the condition of anonymity because he was not authorized to speak to the press. “Our people are clever, and they have a strategy, so we don’t have people killed that way.”

The Iranian-backed fighters from the League, the Salaam Brigades and another group, the Hezbollah Brigades, already have two wars under their belts, fighters said.

Known for their use of sophisticated Iranian-made roadside bombs that can penetrate American armored vehicles, the groups fought against both United States and Iraqi Sunnis during the U.S. occupation here.

More recently, League and Hezbollah fighters have traveled to Syria to join President Bashar al-Assad’s forces battling Syria’s predominantly Sunni rebels.

Each militia has its own section in the holy city of Najaf’s Valley of Peace cemetery.

On a recent afternoon, a hot wind carried the stench of recent burials over the graves, jerking the militias’ flags. Framed portraits of young men in military garb, clutching assault rifles, cast shadows.

There was Ahmed Hussein al-Saadi, who died June 6 fighting in Samarra, and Ali Katea al-Mayadi, who died July 9 “defending the believers of the Islamic resistance League of the Righteous.”

Risk of sectarian war

Although they may have suffered fewer casualties than Iraq’s regular armed forces, Khazali said his men are “playing a fundamental role in defending Baghdad.” They are also fighting in the militant-held provinces of Salahuddin and Anbar and in mixed areas of Diyala and Babil provinces, he said.

The militias’ track records and current activities appear to heighten the risk of full-scale sectarian war erupting.

In Sunni neighborhoods of Baghdad, residents spoke of the ferocity of the groups, which they said show even less restraint than an army that they already identify as sectarian.

“Iraq’s Sunnis are terrified of these militias, which have proven even more brutal and sectarian in nature than official security forces,” said Erin Evers, the Iraq researcher for Human Rights Watch. “With militias in control of the fight in many areas, Sunnis will feel pushed into the arms of Sunni groups.”

Evers noted that Human Rights Watch has documented government-backed militias such as the League of the Righteous, the Hezbollah Brigades and the Badr Brigade “kidnapping and executing people on the basis of their sect.”

Militia leaders acknowledged that their tactics vary from those of the armed forces but insisted that their motives are not sectarian.

“The army has traditional, old tactics on the ground. They can’t shoot unless they have orders,” Zamili said, pointing out that the Islamic State’s tactics, including the use of car bombs and snipers, are better suited to urban fighting.

“The peace brigades are using the same fighting strategies as Islamic State, and that’s why we have succeeded,” he said.

Sharaf al-Hourani in Amman and Heba Habib in Cairo contributed to this report.