TAJI, Iraq (Reuters) - German forces will be needed in Iraq for a long time to help rebuild the country’s military as it struggles to ensure that Islamic State militants do not regroup in underground cells, German Defence Minister Ursula von der Leyen said on Sunday.

Germany, which has about 125 soldiers in Iraq, is committed to supporting Baghdad as it rebuilds now that the fight to reclaim territory formerly held by Islamic State (IS)militants is largely over, she said during a visit to German troops at the Taji military base about 30 kms north of Baghdad.

“The fight against IS left deep wounds and scars in the country. It will take patience ... to strengthen Iraq again,” she said when asked why Germany was bracing for a longer-term engagement in Iraq. “This is about a reconstruction of a country in all areas.”

Iraq not only needed stability but also economic growth and cooperation, von der Leyen told reporters, noting that Germany had invested about 1.4 billion euros (£1.2 billion) in Iraq since 2014.

Germany this year began shifting its military training activities to the central part of Iraq after focussing in the past more on training Kurdish Peshmerga forces in northern Iraq.

German forces will also advise the Iraqi defence ministry on issues such as mine-clearing and development of defences against nuclear, biological and chemical weapons, von der Leyen said.

She welcomed news that Iraq’s parliament had elected Sunni lawmaker Mohammed al-Halbousi as speaker on Saturday, calling it an important step in the right direction.

Von der Leyen, whose government is in talks about a possible role for Germany in military strikes against future chemical weapons use in Syria, said all players in the possible future Iraqi government had said they hoped for Germany’s longer-term commitment to Iraq.

On Saturday, during a visit to German forces in Jordan, von der Leyen had said she could not rule out a longer-term deployment of German forces in the Middle East.