CAIRO - Iraq may need three years to rebuild and restructure its military, Prime Minister Haider al-Abadi said on Sunday, as the country battles Islamic State militants who pose the biggest threat to its security since the fall of Saddam Hussein in 2003.

The ultra-hardline militant group seeking to redraw the map of the Middle East swept through the north last June virtually unopposed by the army, raising alarm bells among Baghdad’s Western allies and in Arab capitals. Corruption is widely blamed for the near collapse of the army, which received billions of dollars in support from the United States during the American occupation but has failed to stabilise Iraq, a major OPEC oil producer. Abadi acknowledged that creating a more effective army could be challenging.

 while he fights Islamic State, seen as far more dangerous than al Qaeda, its predecessor in Iraq.

‘The most difficult thing is to restructure and build the army while you are in a state of war,’ Abadi told Reuters in an interview during a visit to Cairo. ‘Our aim is to create a balance between both, restructuring the army in a way that will not impact the fighting,’ added Abadi, a British-educated engineer.

U.S.-led air strikes have helped Iraqi military forces and their Shi’ite militia allies as well as Kurdish fighters seize back territory from Islamic State. But the militants’ effective use of suicide bombers and improvised explosive devices often slow down government forces. ‘Restructuring the army could take three years,’ said Abadi. ‘This does not mean that the fighting with Islamic State will last for three years.’

U.S. military officials say the conflict could last for years and that defeating the group hinges on Iraq’s ability to create a more effective army. In Cairo, Abadi discussed regional efforts to stamp out militancy and other issues with Egyptian President Abdel Fattah al-Sisi, whose country also faces Islamist militant insurgents based in the Sinai Peninsula who have pledged allegiance to Islamic State.