The stage was set Friday for a major sectarian confrontation in Iraq after the government and the country’s most powerful Shiite cleric implored civilians to take up arms against Sunni militants — a move that would partially plug the ranks of the decimated security forces with religiously motivated volunteers.

Those developments appeared directly at odds with the approach urged by President Obama in Washington, who appealed to the Iraqi government to find ways to bridge the country’s sectarian divisions.

After an offensive this week by the al-Qaeda-inspired Islamic State of Iraq and Syria (ISIS) triggered a massive retreat by security forces in the north, the government turned to its citizenry for help, issuing a call for volunteers to join the battle. On Friday, that call was echoed in a message from Grand Ayatollah Ali Sistani, delivered at prayers in the southern city of Karbala, a Shiite holy city.

Baghdad residents said those signing up are largely members of Shiite militias notorious for bloodletting during the darkest days of Iraq’s civil war, raising fears of a return to levels of sectarian violence that could tear the country apart.

The new recruits will face militants who have received a significant military boost from warehouses of equipment left behind by the retreating Iraqi army.

The Islamic State of Iraq and Syria (ISIS), an al-Qaeda splinter group that has seized a huge chunk of northern Iraq, is led by Abu Bakr al-Baghdadi, a relatively unknown and enigmatic figure. (The Washington Post)

Hisham al-Hashemi, an Iraqi security analyst who claimed to be privy to Defense Ministry estimates, gave a glimpse of how devastating the losses to the Iraqi army may have been. He said the rout has cost the army equipment worth $1.3 billion, including 72 tanks — much of it hardware supplied by the United States.

In the past, Sistani has issued conciliatory statements that have pulled Iraq back from civil war. But the cleric was blunt Friday, with his representative urging anyone who can carry a weapon to take up arms against the militants.

“Citizens who are able to bear arms and fight terrorists, defending their country and their people and their holy places, should volunteer and join the security forces to achieve this holy purpose,” he said in a sermon.

Prime Minister Nouri al-Maliki, himself a Shiite, has long been accused by both Shiite and Sunni opponents of stirring divisions between the Muslim sects in order to cling to power. On Friday, he chose to visit a shrine in the city of Samarra that has been the focus of major sectarian attacks — not the action of a leader promoting a message of unity.

Iraqi state television showed recruits who will be used to protect sites such as the Samarra shrine — where ISIS forces attempted an assault this week — scrambling to board packed army trucks.

An Iraqi official said the number of new recruits had reached 30,000 Friday, but that number does not approach the roughly 90,000 soldiers who he said earlier had “evaporated overnight” as ISIS advanced. The official spoke on the condition of anonymity because he is not authorized to provide the figures.

He blamed Sunni officers for capitulating in the face of the advance, leaving largely Shiite soldiers rudderless.

How the Islamic State is carving out a new country

The Iraqi security forces, on which the United States has spent billions for arms and training, are “increasingly going to become another Shiite militia in all but name,” fighting alongside other Shiite militias and the Iranians, according to Kenneth M. Pollack of the Washington-based Brookings Institution.

“This is the start of the Iraqi civil war that was so obviously going to break out after we washed our hands of it,” he said.

Shiite cleric Moqtada al-Sadr, head of a militia known as the Mahdi Army, has called for civilians to protect Iraq’s Shiite shrines. So has Asaib Ahl al-Haq, a resurgent Shiite militia that is close to Maliki.

“Those volunteering are thrilled by thinking this is a religious war,” said Walid Issa Taha, a Baghdad resident who left for the safety of Jordan on Thursday night through a packed airport, joining many others with the means to flee. “It’s all religiously motivated.”

Maliki is also looking to Shiite Iran for support. Iranian state television reported Friday that President Hassan Rouhani had spoken with Maliki overnight and pledged Iran’s support for the Iraqi government and its people.

Hossein Salami, an Iranian Republican Guard general, said his forces are “in full combat readiness” should they be needed and blamed the bloodshed on years of “blatant interference” in the Middle East by the United States and other Western nations.

Since seizing the northern city of Mosul in the face of little resistance this week, militants from ISIS have stormed toward the capital, bolstered by the weaponry abandoned by the fleeing Iraqi army.

“They had full access to huge warehouses,” said Hashemi, the analyst who cited what he said were Defense Ministry estimates on losses.

In addition to the 72 missing tanks, about 700 Humvees and hundreds of armored personnel carriers were lost, he said, as well as thousands of tons of ammunition and two helicopters.

The militants probably do not have all that equipment, he said, noting that they are thought to have seized just a handful of the tanks, which are cumbersome to transport and of little strategic use to them. The others were destroyed, secured by Kurdish forces or simply abandoned, he said.

A Defense Ministry spokesman did not respond to calls Friday.

Evidence of the lightning-fast retreat is scattered across the country’s north. Shot-up police trucks and discarded army uniforms could be seen in fields outside Mosul.

As ISIS continued its advance Friday, fighting intensified in the religiously mixed province of Diyala, close to Baghdad and a theater of some of the worst sectarian fighting during the civil strife that followed the 2003 U.S.-led invasion of Iraq. Militants took control of the provincial towns of Saadiyah and Jalawla overnight Thursday.

The fresh fighting came a day after the al-Qaeda offshoot asserted its authority over Sunni areas in the north and Kurds seized control of the city of Kirkuk.

However, ISIS’s gains have been slowed in areas that are not home to a significant Sunni population. Its advance has been assisted by supporters of former president Saddam Hussein as well as by general Sunni disaffection with the Shiite government.

“One of the big questions right now is whether ISIL can turn its tactical victories in Iraq into strategic gains,” a U.S. counterterrorism official said of the group, which is also known as the Islamic State of Iraq and the Levant, adding that it was unclear whether the group can hold territory.

“The situation on the ground right now is playing to ISIL’s strengths, but the group faces the real prospect of overstretch if it tries to press deep into Baghdad and beyond,” the official said.

Still, there was an air of panic in Baghdad on Friday, residents said, with food prices doubling in markets as civilians stockpiled groceries.

Hashemi agreed that ISIS was unlikely to reach Baghdad but said the militants’ aim was to establish a presence in Sunni-majority neighborhoods on the city’s outskirts.

“They are more interested in the Baghdad belt,” he said, adding that they want to reestablish the presence Sunni insurgents had in the area before the U.S. Army co-opted Sunni tribal forces to push them out.

Liz Sly and Ahmed Ramadan in Beirut, Jason Rezaian in Tehran and Greg Miller in Washington contributed to this report.