ERBIL, IRAQ – In April, Iraqi Prime Minister Haider al-Abadi sat at a conference table in his Baghdad office with almost two dozen men in combat fatigues. The men were not officers in the Iraqi Army, but representatives of the Shi’ite paramilitary groups that have led the fight against Islamic State.

Hadi al-Amiri, one of the most senior militia leaders, delivered a long and forceful monologue on his fighters’ recent victories. Abadi, in a blazer and tie, listened, occasionally jotting down notes, a video of the meeting shows. A few minutes later, Abadi himself praised the fighters.

The event was a sign of the delicate power balance in Iraq.

Abadi, a Shi’ite, came to office just over a year ago backed by both the United States and Iran. He promised to rebuild the fragmented country he inherited from his predecessor, Nuri al-Maliki, who was widely accused of fueling sectarian divisions. Since then, though, even more power has shifted from the government to the militia leaders.

Those leaders are friendly with Abadi. But the most influential describe themselves as loyal not only to Iraq but also to Iran’s supreme leader, Ayatollah Ali Khamenei. Three big militias – Amiri’s Badr Organisation, Asaib Ahl al-Haq and Kataib Hezbollah – use the Iranian Shi’ite cleric’s image on either their posters or websites. Badr officials describe their relationship with Iran as good for Iraq’s national interests.

Initially, Abadi had little choice but to lean on the Shi’ite paramilitary forces. They grew in power after Sunni extremist group Islamic State captured large parts of northern Iraq in June last year and Iraq’s top Shi’ite cleric, Grand Ayatollah Ali al-Sistani, called for volunteers to fight Islamic State, which soon declared a caliphate straddling the border with neighbouring Syria.

As the Shi’ite militias’ popularity surged, Abadi publicly lamented the lack of Western support. He made plain his desperate desire for help earlier this month after Iran and Russia opened offensives against the group in Syria. The prime minister said he would welcome Russian air strikes in Iraq as well. Abadi is looking not just to hurt Islamic State but to bolster his own position in Iraq.

Over the past few months he has attempted to impose his authority on the militia commanders and their political allies, and remind Iraqis he is the country’s legitimate leader. That is stoking tensions around who controls Iraq.

Abadi’s resources remain limited. Iraq’s regular military has not recovered from last year’s defeat by Islamic State. Most young Shi’ite Iraqi men now prefer to join the paramilitary groups, which are seen as braver and less corrupt.

“The alternative is chaos and the return of abhorrent dictatorship.” Haidar al-Abadi, Iraqi Prime Minister

One army division is now under informal militia command, according to U.S. and other Western military officers. Shi’ite paramilitary elements have taken at least partial control of the Interior Ministry, according to security officers, Iraqi politicians and U.S. military officials. The Iraqi government rejects that claim.

The Shi’ite militias, which dominate most frontlines, say they support the government and pose no threat to Iraq’s minority Sunni sect. The Popular Mobilisation Committee, or Hashid Shaabi, as the militias are collectively known, belongs “to the Iraqi government,” said Naim al-Aboudi, a spokesman for the Asaib Ahl al-Haq militia. “The Hashid doesn’t represent a sect. It represents all Iraqis.”

But the militias make no secret of their independence from Baghdad. Militia leader Amiri warned in a televised interview last month that if the Shi’ite groups did not approve of U.S. military operations in Iraq, “We can go to Abadi and the government and … pressure them: ‘Either you will do this, or we will do that.’” Amiri did not specify what action his group would take.

A senior Iraqi government official close to the prime minister said the militias operate independently. He said their objectives only sometimes align with Abadi’s: They concentrate on defending areas that are strategically important for their sect.

“If they are not paid by the prime minister,” this official said, “they can do what they want.”

Abadi came to power in September 2014, promising to heal the Sunni-Shi’ite rift and end graft. But those early ambitions soon ran out of steam. After public protests broke out in late July over electricity and water supply problems, he launched a new anti-corruption campaign. He also said he would prune his government, cutting his three deputy prime ministers and the three vice presidents, one of whom is his predecessor Nuri al-Maliki.

Amiri and fellow militia leader Abu Mehdi Mohandis, a close ally of Iran’s Revolutionary Guards, have warned that the outcry for reform threatens Iraq’s democracy. The prime minister’s three deputies have defied him, questioning the legality of his decisions.

Tensions are rising. Men affiliated with the paramilitaries have beaten protesters, who include secular activists, ordinary citizens and reform-inclined Islamists. Protesters say at least two demonstrators have been killed since August.

Abadi’s next steps will help determine whether the state can reassert itself. “Can Abadi deliver?” asked secular lawmaker Mithal Alusi. “Not like this … Abadi is so weak he will not be able to deliver anything.” Alusi also accused Iran’s Revolutionary Guards, which back some of the militias, of weakening the prime minister in the name of “having chaos, so they can control everything.”

Abadi insists he will continue to tackle corruption and repair the political system. “I will not back down even if it costs me my life,” he said in a speech in late September to relatives of Iraqis killed fighting Islamic State. “The alternative is chaos and the return of abhorrent dictatorship.”

MR NO-YES

Abadi’s father was a Baghdad doctor fondly remembered for tending the poor. Abadi moved to Britain as a young man to study engineering. While he was in Britain, two of his brothers died at the hands of Saddam Hussein’s Sunni-dominated regime.

Like his brothers, Abadi opposed the regime. But he also earned a reputation within Iraq’s dissident circles as someone who changed his mind depending on circumstances, according to three people who know him. Colleagues nicknamed him Mr No-Yes.

When Abadi’s government took office last September after a decade of sectarian conflict, it represented a new chance to unify Iraq.

His predecessor Maliki, also a Shi’ite and member of the conservative Islamist Dawa party, had polarised the country. Abadi spoke of reconciliation and appealed to Iraq’s three main religious and ethnic groups – Sunni, Shi’ite and Kurd. Early on, he froze air strikes on civilian areas, regardless of the presence of Islamic State.

Abadi has long advocated unity. During the civil war in Iraq in 2006, as suicide bombers attacked Shi’ite markets and Shi’ite militias carried out reprisals, he said it was wrong to evict Sunnis from Baghdad. In the end, he said, all citizens would have to live together.

But he has also regularly gone along with hardliners in his Dawa party. And in power, he has struggled to fulfil promises, according to a former adviser. When he took office, Abadi vowed to end appointments based on party affiliation, for instance. But while he appointed a Sunni defence minister, he also named Dawa stalwarts to head government bodies, including the anti-corruption and media watchdogs.

Abadi’s spokesman, Saad al-Hadithi, dismissed doubts about Abadi’s resolve. “On the contrary, he has committed himself to these reforms,” Hadithi said. “He can't just press a button and it will be done. There are obstacles and some corrupt sides standing against him.”

WHOSE ARMY?

Abadi took office facing many challenges. He inherited a military that had all but collapsed. Three months before he became prime minister, Islamic State overran the army in Mosul, the largest city in the north. At its height, the militant group, which has used rape as a weapon of terror and executed Iraqi Shi’ites and Christians, controlled nearly a third of Iraq.

Abadi also faced a budget crunch because of his predecessor’s heavy spending and the plummeting oil price. His backers lamented that a decent man, with little leadership experience, had been dealt an impossible hand.

Early on, Abadi struggled to work out what was left of the army and federal police. “There wasn’t really a good picture of how many soldiers, how many police he really had, and who the hell is really on the rolls,” said Lieutenant General Mick Bednarek, the senior U.S. military officer in Iraq from 2013 until July. Bednarek said Abadi and his defence minister worked hard on the issue and by November last year recognised the military was “ill prepared and lacking in leadership."

“The Iraqi security forces had no clue. And Abadi had no idea. He wasn’t happy about it.” Lieutenant General Mick Bednarek, former senior U.S. military officer in Iraq

Abadi announced he had identified 50,000 “ghost soldiers” – fighters who don’t exist but whose salaries are collected - and scrapped their positions. Critics believe there are many more ghost soldiers.

Abadi also turned to the militias for support. “He doesn’t like it,” said Bednarek, who retired in late August. “But he has to, because Iraqi security forces can’t do it alone.”

The Hashid Shaabi now commands more than 100,000 fighters. On paper, it receives over $1 billion from Iraq’s state budget. Two Iraqi officials said the militias get additional funding from other sources, including Iran, religious clerics and political figures, but declined to give details. U.S. military officials believe large amounts of funding come from Iran.

Aboudi, the spokesman for the Asaib Ahl al-Haq militia, and Muen al-Kadhimi, a senior Badr official, said Iran provided money to Shi’ite armed groups before 2011. They said the payments stopped because of Iran’s economic troubles and the withdrawal of U.S. soldiers from Iraq. Kadhimi said Iran still sends advisers and weapons to the militias via the Iraqi government. But Baghdad pays for all such equipment, he said.

Money has been harder to secure for Iraq’s Defence Ministry. It spent months this year unable to fund a plan to hire 10,000 new recruits. The funds were finally approved in September. Attracting recruits has also proved difficult because most men prefer the militias.

“We have difficulty attracting Shi’ites and Sunnis to the army … because of the damage that has been done to the army’s reputation,” said the senior government official close to Abadi.

Since the U.S. military opened training camps for the army in January, the army has failed consistently to find full brigades to send for training, Bednarek said. He estimates the army has only five functioning divisions – roughly 50,000 men, whose fighting readiness ranges between 60 and 65 percent.

Some of the best military and police – more than 80,000 men – are now based in Baghdad, Bednarek said, because Abadi wants to make sure the capital does not fall to Islamic State.

The Shi’ite militias have also made inroads within the government security apparatus.

The Fifth Iraqi Army Division now reports to the militias’ chain of command, not to the military’s, according to several U.S. and coalition military officials. The division rarely communicates with the Defence Ministry’s joint operation command, from which Abadi and senior Iraqi officers monitor the war, the officials said.

Kadhimi, the senior Badr official, disputed that account. He said the Fifth Division does report to militia leader Amiri, but only because the Iraqi government had assigned him responsibility for security in the eastern Diyala region. Kadhimi said the Fifth Division still takes orders from the Defence Ministry’s chain of command. The Defence Ministry also said the normal chain of command has not changed.

Iraqi security officers, Iraqi politicians and U.S. and Western military officers say the Interior Ministry has become another militia domain. The ministry came under the influence of Shi’ite militias previously, in 2005, and was accused of running death squads.

Today it is run by Mohammed Ghabban, a senior member of the Badr militia. Badr fighters fought alongside Iranian soldiers in the 1980-1988 Iran-Iraq war. Ghabban once worked as the personal secretary to Badr chief Amiri.

One security officer in the Interior Ministry estimated that more than 70 percent of those working there are now loyal to militias – in particular Badr. The ministry also trains paramilitary fighters, the first security officer said, including special operations forces.

The Interior Ministry does not inform Abadi of all its activities and won’t account for all the men on its rosters, according to a senior Iraqi government official.

Abadi spokesman Saad Hadithi said that rogue officers, loyal to different parties, had been working inside both the Interior Ministry and the Defence Ministry. But he said Abadi has started firing them.

“Some sides are trying to exploit this situation in order to achieve some political privileges, and we are confronting those people,” said Hadithi.

The Interior Ministry declined to comment on that for this story.

Badr official Kadhimi said the allegations about the Interior Ministry were untrue, spread by embittered officers who lost power under the new minister.

“THEY ARE OUTLAWS”

While Abadi relies on the Shi’ite militias, he has expressed frustration at the limits to his authority. Not all militia activities are reported to him. This became clear in April, as the militias, without informing him, began shelling civilian areas as part of their campaign to retake the majority-Sunni city of Tikrit from Islamic State.

The action caught Abadi by surprise. “The Iraqi security forces had no clue. And Abadi had no idea. He wasn’t happy about it. They didn’t seek his permission,” said Bednarek.

Video: Iraq’s powerful Shi’ite militias

Abadi tried to assert control by calling in U.S. air strikes against Islamic State. But after the strikes helped force Islamic State to abandon Tikrit, Shi’ite militia fighters went on the rampage, looting and torching buildings. The looting happened hours after Abadi had toured the city.

A further blow came in May when Islamic State took the western city of Ramadi. Bednarek attributed the defeat to the military’s poor morale. An officer in the Iraqi Special Forces withdrew the men under his command, Bednarek said, because he was worried about missing an official trip abroad. The officer’s departure triggered a mass panic as other units saw his men fleeing.

As Islamic State’s bloody campaign grinds on, the Iraqi state is struggling to regulate the militias’ response.

On Aug. 10, an Islamic State suicide bomber attacked a Shi’ite wedding party in the eastern city of Baquba, killing 58. Shi’ite militia fighters responded by killing local Sunnis and dumping 25 or more bodies in the city’s river, according to local officials. The massacre went unreported in local media.

In Tikrit, where thousands of residents returned after the defeat of Islamic State in April, people say they now live in fear of militias. Kidnappings and robberies by men in security uniforms have also risen in Baghdad. Alarmed, Abadi addressed the issue at a gathering of police, warning “there was a challenge against the state.”

“These groups don’t represent the security forces, nor the Hashid,” he said. “They are outlaws and we must fight them.”

PANIC: Sunnis fleeing fighting between Iraqi forces and Islamic State in Ramadi in April arrive on the outskirts of Baghdad. REUTERS/Stringer EXODUS:The rise of Islamic State has forced thousands, including these Sunnis in May, from their homes. REUTERS/Stringer TEARS: In May, another wave of Sunnis from Ramadi arrived in Baghdad after fresh fighting in the so-called Sunni triangle. REUTERS/Stringer

————— The War for Iraq By Ned Parker in Erbil and Washington Photo editing: Simon Newman Design: Catherine Tai Video: Zachary Goelman Edited by Simon Robinson