In this June 23, 2014, file photo, fighters from the Islamic State group parade in a commandeered Iraqi security forces armored vehicle down a main road at the northern city of Mosul, Iraq. An online image released Wednesday purported to show the Islamic State affiliate in Egypt had beheaded a Croatian hostage. (Uncredited/AP)

The top Iraqi army officer for Mosul remained on vacation last summer despite repeated warnings that Islamic State militants were planning to seize the city, and his units had less than a third of the soldiers they were supposed to have on the day of the battle.

Those were some of the findings outlined in a 114-page Iraqi parliamentary report on why security forces in northern Iraq’s largest city collapsed so rapidly as militants attacked in June 2014. The report, based on the testimony of at least 92 officials, has not been made public, but The Washington Post obtained a copy.

The account of the attack and the events leading up to it sheds light on a poorly run, underequipped army that the United States spent $25 billion to train and equip. It describes armed forces plagued by rivalries and desertions, which officers covered up in order to pocket the salaries and living expenses of the absent soldiers.

The Islamic State, meanwhile, had been running a highly organized, mafia-style operation in the city in the months and years before the attack, extending its grip and boosting its finances. By the time Mosul fell, the group was earning $11 million a month in extortion and racketeering, the report said.

“It was an event that surprised the world,” the report said of the fall of Mosul. “But those who were informed about the security situation in the province realized this was going to happen eventually.”

There was ample warning. The Islamic State began destroying bridges and blocking supply routes to the city six months before the attack. Iraqi officials ignored numerous intelligence reports specifying that a major assault was being planned for the beginning of June, the report said.

Intelligence services provided the coordinates of Islamic State bases, and an airstrike could have stopped the attack, the report said. But “that strike never happened.”

The armed forces lacked effective command and control, with multiple competing decision-making centers, the report said. Senior commanders who made “grave” mistakes during the assault were appointed for political reasons rather than for their experience, it said.

Prime Minister Haider al-Abadi is attempting to curb corruption in the security forces, and the United States is spending a further $1.3 billion to arm and train Syrian and Iraqi forces to fight Islamic State militants. But Iraqi commanders concede that the army is still plagued by logistical and leadership challenges. Efforts to recapture the western city of Ramadi have made little progress, while talk of a counteroffensive for Mosul has long dissipated.

As the date of last year’s assault approached, communications from Iraqi intelligence to the armed forces and prime minister’s office became more detailed and urgent. On May 20, 2014, intelligence services warned the army of a large-scale attack in “early June.”

After several more cables, Iraqi intelligence on May 28 specified the neighborhood that the militants would use to launch their offensive. Later that day,senior commanders held an emergency meeting. But Lt. Gen. Mahdi Gharawi, head of the Nineveh Operations Command, was on vacation and did not attend, the report said. He returned to be briefed just hours before the attack began on June 5.

Gharawi is one of 35 officials who have been implicated in the parliamentary investigation. He has since been dismissed and did not respond to requests for comment, but he has previously said he did not order a retreat and fought until the city was overrun.

A decision by Gharawi and Aboud Qanbar, the Defense Ministry’s deputy chief of staff, to withdraw from the Nineveh Operations Command headquarters during the battle with a convoy of Humvees sparked panic among soldiers, who thought they were deserting, the report said.

Nouri al-Maliki, Iraq’s prime minister at the time, who also held the positions of defense minister, interior minister and head of the armed forces, was also named in the report, which has been handed over to Iraq’s judiciary.

“He was the number one person responsible,” said Hakim al-Zamili, head of the 26-member parliamentary committee that oversaw the investigation. “We lost a third to half of our territory because of Maliki — a huge number of martyrs, equipment, money. It’s all because of Maliki; he’s the commander in chief.”

In his testimony to the committee, Maliki said commander in chief of the armed forces is only an “advisory” position anddoes not involve responsibility for “field work.”

Maliki has called the report “worthless” and has questioned its objectivity.

Zamili is from the rival Sadrist bloc and was accused of running death squads during the worst years of Iraq’s sectarian bloodshed.

He rejects allegations of political bias, saying that members of parliament from a variety of parties signed off on the report.

Less than 30 percent of the fighting force that was supposed to be on the ground in Mosul was present the day of the Islamic State attack, the report said. Just a quarter of the soldiers of the 6th Infantry Brigade of the Iraqi army’s 3rd Division were on duty — even though the unit constituted one of the city’s first lines of defense.

An inspection before the assault found that half the soldiers did not exist, and that half of those who did were on leave at any given time. That led to “exhaustion in the ranks” and low morale. Officers did not report desertions but stole the salaries of the absent soldiers, the inquiry found.

The army made mass arrests and extorted thousands of dollars from citizens, who were charged $2,000 to $3,000 to secure the release of each detained relative, the report said. Meanwhile, militants could also pay for the release of their commanders. One commander who was arrested two months before the fall of Mosul was released for $70,000, according to the report.

The local government is accused of turning a “blind eye” as the militants extended control over government offices and collected taxes and protection money.

The attack was preventable, Zamili said. “If there had been security leaders with vision, it would have been possible to stop this,” he said. “They only worked in the last days. There was no urgency. They didn’t have a brain between them. They were not leaders at all.”

Mustafa Salim contriuted to this report.

Read more:

One year ago, Islamic State stepped into the global spotlight. Here’s what has happened since.

Watch: What Palmyra looked like in the 1800s, and how the Islamic State is destroying it

Ex-premier Maliki on hot seat in Iraq over fall of Mosul to Islamic State