A car is engulfed by flames during clashes in the city of Ramadi, May 16. (Stringer/Iraq/Reuters)

It was around 9 p.m. when police Col. Hamid Shandoukh peered across the dark waters of the Euphrates River and spotted the skiffs carrying Islamic State fighters toward his front line in the city of Ramadi.

The commander mustered his forces — a mixture of tribal fighters and local policemen — to defend their position on the river snaking through the city.

But it soon became clear that this was no ordinary assault. As the security forces trained their guns on the river in front of them, they came under attack from behind.

“It was a case of complete chaos,” Shandoukh said. “We thought the areas behind us were secured.” But the Islamic State had activated sleeper cells in the city.

The attack in the Albualwan neighborhood on May 14 marked the beginning of the end for pro-government forces in Ramadi, a strategic city that had held out during nearly 18 months of assaults by the Islamic State. The insurgents launched a sophisticated, multipronged attack over four days, using as many as 30 car bombs.

But new accounts from fighters in the city indicate that the fall of Ramadi owed as much to the weakness of Iraq’s forces and holes in U.S. strategy as to the Islamic State’s strength.

Soldiers described confusion and a lack of coordination between branches of the security forces as chains of command broke down.

Even Iraq’s Golden Division — a U.S.-trained special-forces unit considered the most capable in the country — suddenly deserted its positions, security officials said.

Planes from the U.S.-led coalition bombed the edges of Ramadi, but there simply weren’t enough airstrikes, Iraqi military officials said.

Tribal fighters complained that as the city came under attack, they were still scraping together money to buy ammunition on the black market, despite the fact that train-and-equip programs for local Sunni tribal forces were a cornerstone of the U.S. strategy to confront the extremist group.

The Islamic State fighters shocked Iraqi security forces with their coordinated assault. After taking over Albualwan on Thursday night, the militants seized the nearby Jamia area. Other attacks were launched from the al Soufiya and al Hoz neighborhoods. Some members of the sleeper cells were dressed in police uniforms, confusing the pro-government fighters.

Displaced Sunni people, who fled the violence in the city of Ramadi, arrive at the outskirts of Baghdad, May 19. (Stringer/Iraq/Reuters)

The extremists made steady gains against fighters who were war-weary and lacking supplies. Army units were stretched thin.

By Friday afternoon, the Islamic State had hoisted its black flag over the city’s government compound and surrounded the city’s military headquarters.

The militants detonated 17 vehicle bombs that day, according to Ramadi’s governor, Sohaib Alrawi. Bombers sped toward their targets in dump trucks and bulldozers armored with thick steel plating, which protected them from gunfire and rocket-propelled grenades.

During the ferocious attacks Friday and Saturday morning, planes from the U.S. coalition carried out just four strikes in the area, according to media releases, with seven more over the following 24 hours.

“There were only weak, shy airstrikes on the edges of the city,” said Sabah Karhout, the head of Anbar’s provincial council.

President Obama in an interview published last week attributed the loss of Ramadi to shortcomings in training and developing Iraq security forces.

Pentagon officials have said that Iraqi forces withdrew from Ramadi in part because they mistakenly assumed that the U.S.-led coalition could not launch airstrikes during a sandstorm. “The weather did not impact our ability to conduct airstrikes,” Pentagon spokesman Col. Steve Warren told reporters on Thursday. Residents and fighters in the city said the weather was largely clear after the initial attack on Thursday, which occurred during a light dust storm. That dust, however, may have allowed the Islamic State fighters to position themselves before the assault, undetected by aerial surveillance.

Reluctant to be drawn into a combat role, the Obama administration has held back from deploying spotters on the ground to relay real-time information to nearby attack aircraft, limiting the capabilities of strikes.

‘There was chaos’

As the fall of Ramadi appeared imminent, the Iraqi government tried to push back the Islamic State fighters from the largely Sunni city, where authorities had refrained from deploying Shiite militiamen who have led the battle elsewhere.

On Saturday evening, a column of 30 federal police armored vehicles arrived in Ramadi. Around noon on Sunday, the convoy attempted to head for the government compound, where some police forces were still stranded. But on reaching the turquoise-domed Al Dawlah al-Kabir mosque in the city center, the vehicles came under heavy attack and turned back, fighters said.

“When the forces who were meant to reinforce us retreated, our morale was completely broken,” said Omar Shehan al-Alawni, a tribal fighter in the area.

Another turning point in the battle was the withdrawal of Iraq’s Golden Division.

Maj. Omar Kamis al-Dahl, a 31-year-old policeman, said he had withdrawn to Street 60, a major thoroughfare where he expected to see special forces fighters from the Golden Division.

“We were surprised to find Daesh instead,” he said, using the Arabic acronym for Islamic State, which is also known as ISIS or ISIL.

Fadhil Jalil al-Barwari, the head of Iraq’s special forces, had withdrawn from the city with a group of his men that morning, according to a senior security official who declined to be identified because of the sensitivity of the subject.

“When Barwari retreated with that group, there was chaos, everyone else retreated without an order, ” the security official said.

Barwari declined to comment on the Ramadi withdrawal on Friday, but earlier told Iraq’s Sumaria News that it was “tactical.”

With the counterterrorism troops suddenly pulling out, the limited forces left in the city began collapsing, Karhout said.

“There was no central leadership, no leaders coordinating these forces on the ground,” he said.

Iraqi Prime Minister Haider al-Abadi has ordered an investigation into the causes of the military failure. Ten of the suicide bombings that occurred during the assault had the power of an “Oklahoma City-type attack,” a senior State Department official told reporters in the District, referring to the truck-bomb explosion in 1995 that killed 168 people. But Iraqi officials said the bombings were no more powerful than they experience on a weekly basis — though there were more of them.

The battle also highlighted the animosity and lack of trust between the army and the local police.

Police complained that soldiers at checkpoints confiscated their weapons in the confusion, saying they weren’t allowed to retreat from the city with them, even though officers said they were moving from one neighborhood to another.

“There is so much distrust,” said Dahl. “They consider anyone from Ramadi as a sympathizer with ISIS. And then in many of their operations, Daesh dress in military clothes, so we don’t trust people we see in army uniform.”

As the city’s defenses collapsed,around 1,000 men were besieged in the military headquarters, the Anbar Operations Center, under heavy mortar and rocket fire from insurgents.

An armored forklift pushed away blast walls on the edge of the base, allowing suicide bombers to penetrate, fighters said. At least four powerful explosions rocked the base, one from an explosives-rigged, steel-covered truck which hurtled inside, detonating and killing scores of people.

“Before the attack we obeyed our commanders’ orders, but after the attack, when it came to retreating, we disagreed” with senior officers, who wanted the forces to wait for reinforcements, said a captain with federal police forces on the base.

“We said, ‘Whether you want to or not, we are going to retreat,’ and eventually they came with us,” he said, speaking on condition of anonymity

The security forces broke through the siege but left wounded colleagues behind, fighters said. A total of 286 local policemen died in the battle, the governor said, adding that figures were not available for other branches of the security forces.

Islamic State fighters crowed about their victory on social media, releasing images of the weapons and crateloads of ammunition they had seized. Millions of dollars worth of U.S.-supplied military equipment appeared to be left behind, including dozens of tanks and armored vehicles.

For Dahl and other local fighters it was particularly galling to see photos distributed on social media of stashes of ammunition, when they had struggled to get bullets.

“The sons of Ramadi were fighting for their city,” he said. “All they wanted was ammunition.”

Read more:

After the fall of Ramadi, the Obama administration weighs its options

The hidden hand behind Islamic State militants? Saddam Hussein’s

Militants fortify grip on Palmyra, one of the Mideast’s most renowned sites