A full-blown humanitarian crisis has developed from ISIS takeover of Ramadi, as an estimated 25,000 Iraqi refugees are now making their way east toward Baghdad, seeking food and shelter wherever they can and facing the prospect of being blocked from the capital city amid fears their ranks could include militants.

"Nothing is more important right now than helping the people fleeing Ramadi."

- Lise Grande, UN humanitarian coodinator for Iraq

The United Nations and other aid agencies were handing out food, water and medical supplies along the 60-mile route between the cities, but the situation was worsening amid dwindling supplies and reports the Iraqi army was blocking the refugees from reaching the safety of Baghdad.

"Nothing is more important right now than helping the people fleeing Ramadi," the UN humanitarian coordinator in Iraq, Lise Grande, said in a UN statement. "They are in trouble and we need to do everything possible to help them."

The flight was a repeat of a wave of refugees who poured out of Ramadi in April, when fighting between ISIS and the Iraqi army flared up. Many had returned, only to be again driven out of the city, some 60 miles west of Baghdad.

Now, the crisis could be coming to a bloody head, as the black-clad jihadist army is moving east just behind the refugees, who are now stuck on the bank of the Euphrates River, unable to cross to safety. And those left behind in Ramadi, where ISIS was reportedly going door-to-door to root out government sympathizers, were braced for more fighting as Shia militias were summoned by Baghdad to help mount a counter-offensive to retake the city, once home to 750,000.

Even the decision to launch a counter-offensive to recapture the largely Sunni capital of Anbar province was fraught with peril. The Iraqi Army’s humiliating defeat there has left Baghdad with little choice but to make a deal with the devil – the battle-hardened and Iranian-backed Shia militias that offer the best chance of retaking the key city, say experts.

Shia militias, including the formidable Badr Brigade – Shia fighters who sided with Iran during the 1980s Iraq-Iran war -- are massing outside the city, some 70 miles west of Baghdad. Their plan is to go in with Iraqi Army troops and oust ISIS, which raised its flag over the city center on Sunday.

“The Iraqi Army and the Shia militias are regrouping, and preparing for a counter-offensive in Ramadi,” Rick Brennan, a senior political scientist at the RAND Corporation who spent five years as a senior adviser to the U.S. military in Iraq, told FoxNews.com.

ISIS took the heart of Ramadi, the largest city in Anbar province, after a well-coordinated wave of truck bombs paved the way for fighters to pour in and rout dug-in Iraqi forces. An estimated 500 soldiers and civilians were killed and thousands sent fleeing, leaving behind U.S.-issued weaponry.

Iraqi Prime Minister Haider al-Abadi, himself a Shia Muslim, immediately called on the Shia militias, known as the Popular Liberation Force, to come to Anbar to help fight ISIS, ignoring U.S. concerns their presence could spark sectarian bloodshed in a nation where deep divisions exist between Islam’s two main sects.

Some 3,000 Shia militiamen are reportedly encamped at a military base outside the city. Youssef al-Kilabi, a spokesman for the Shia militias fighting alongside government forces, told the AP on Monday that the Iranian-backed paramilitary forces have drawn up plans for a Ramadi counter-offensive in cooperation with government forces.

"[We will] eliminate this barbaric enemy," al-Kilabi vowed.

Iran's Defense Minister Gen. Hossein Dehghan flew to Baghdad on a surprise visit for urgent talks with Iraqi leaders.

While the Iraqi government, Iran and the Shia militias, who have all sworn allegiance to Iran’s Ayatollah Khamenei, for now share the common goal of defeating ISIS, analysts as well as Sunnis warn that the increasing dependence on Iran will threaten Iraq’s sovereignty down the road.

One U.S. official, speaking to The Associated Press on condition of anonymity, described Ramadi as "a powder keg" and said any use of militia has "got to be dealt with very, very delicately."

"There's the potential it can go very, very badly," the official said, without predicting such an outcome.

In the Sunni-majority Anbar province, tribal elders also object to Baghdad’s invitation to Shia militias, saying the government should instead be arming volunteer fighters there.

"If the Shia militias enter Ramadi, they will do the same things being done by [ISIS]," Abu Ammar, an Anbar native who owns a grocery store in Ramadi, told the AP. "In both cases, we will be either killed or displaced. For us, the militias and [ISIS] militants are two faces of the same coin."

The Shia militia fighters were responsible for some of the Iraq War’s most brutal atrocities against Sunnis, and work closely with the Iranian Republican Guard.  The U.S., which is providing air and logistical support but does not have enough people on the ground to effectively help in an urban counter-offensive, has insisted that the Shia militias work under the supervision of Iraqi Army officials. Although the militias have agreed to those terms for now, Iraq’s dependence on them could complicate matters.

“In the short term, you have the immediate threat of ISIS. But in the long term, the deeper threat is to Iraq’s ability to be free and independent of Iran,” Brennan said. “Dependence on the Shia militias, who have sworn allegiance to the ayatollah, is a problem.

The Popular Liberation Forces number about 70,000, including a core of 15,000 hardened fighters who most recently did battle at Tehran’s behest in Syria, where they fought Al Qaeda, ISIS and the Free Syrian Army, Brennan said. Iraq may need their help now, but giving them an official role in the fight against ISIS could further entrench them as both a political and military force within Iraq, Brennan said.

“I call it the ‘Lebanonization of Iraq,’ where you could end up with a central government, but one that is unable to assert itself by the exclusive monopoly of the use of force,” Brennan said.

Republican senators John McCain and Lindsey Graham, among the most outspoken critics of Obama’s foreign policy, also expressed concern about Iranian-backed Shia militias launching an offensive.

"Whatever operational success [Shia] militias may have in Anbar would be far exceeded by the strategic damage caused by their violent sectarianism and the fear and suspicion it breeds among Iraqi Sunnis," they said in a joint statement.