BAGHDAD — U.S. combat troops will not stay on in Iraq after the fight against the Islamic State group is over, Iraq's prime minister said Friday — a statement that followed reports on talks between Iraq and the United States on maintaining American forces in the country.

A U.S. official and an official from the Iraqi government told AP this week that talks about keeping U.S. troops in Iraq were ongoing.

The U.S. official emphasized that discussions were in early stages and that "nothing has been finalized." Both officials spoke on condition of anonymity in line with regulations.

In his statement, Haider al-Abadi emphasized that there are no foreign combat troops on Iraqi soil and that any American troops who stay on once ISIS militants are defeated will be advisers working to train Iraq's security forces to maintain "full readiness" for any "future security challenges."

While some U.S. forces are carrying out combat operations with Iraqi forces on and beyond front lines in the fight against ISIS, al-Abadi has maintained that the forces are acting only as advisers, apparently to get around a required parliamentary approval for their presence.

Any forces who remained would continue to be designated as advisers for the same reason, the Iraqi government official had told  AP.

Regardless of how the troops are designated, talks about maintaining American forces in Iraq point to a consensus by both governments that a longer-term U.S. presence in Iraq is needed to ensure that an insurgency does not bubble up again once ISIS militants are driven out — a contrast to the full U.S. withdrawal in 2011.

Currently, the Pentagon has close to 7,000 U.S. troops in Iraq, many not publicly acknowledged because they are on temporary duty or under specific personnel rules. At the height of the surge of U.S. forces in 2007, there were about 170,000 American troops in the country. The numbers were wound down eventually to 40,000, before the complete withdrawal in 2011.

The U.S. intervention against ISIS, launched in 2014, was originally cast as an operation that would largely be fought from the skies with a minimal footprint on Iraqi soil. Nevertheless, that footprint has since expanded, given the Iraqi forces' need for support.

Iraqi forces are struggling to retake the last remaining Mosul neighborhoods that ISIS holds in the city's western half, but even after a territorial victory, Iraqi and U.S.-led coalition officials have warned of the potential for ISIS to carry out insurgent attacks in government-held territory.

Associated Press writer Bradley Klapper in Washington contributed to this report.