The US has been leading a coalition to crush the Islamic State group which grabbed swathes of Syria and Iraq in 2014
Iraqi politicians on Monday hit back at Donald Trump after the US president said he plans to keep American forces in the country to spy on Iran.
In an interview with CBS television, Trump reaffirmed his determination to pull the United States out of "endless wars" in Syria and Afghanistan but said American troops would stay on in Iraq, partly "to be looking a little bit at Iran."
"We spent a fortune on building this incredible base. We might as well keep it," he said, referring to Ain al-Asad air base in western Iraq that he visited in December.
"If somebody is looking to do nuclear weapons or other things, we're going to know it before they do," he said in the interview aired on Sunday.
His comments sparked a new round of demands in Baghdad for US forces to leave the country.
"The Iraqi constitution rejects the use of Iraq as a base for hitting or attacking a neighbouring country," President Barham Saleh said.
Saleh said US forces were in the country legally under an agreement between the two countries, but that "any action taken outside this framework is unacceptable."
Iraq's government plays a delicate balancing act between its two main allies, Washington and Tehran, which are bitter enemies.
The US has been leading a coalition to crush the Islamic State group which grabbed swathes of Syria and Iraq in 2014, and multiple offensives have since ousted the jihadists from all but a sliver of territory in eastern Syria.
Baghdad's position has also been complicated by Trump's shock December decision to pull troops out of neighbouring Syria, prompting pro-Iran factions to step up calls for an accelerated US withdrawal from Iraq.
Sabah al-Saadi, a member of parliament in the bloc led by influential anti-American Shiite cleric Moqtada Sadr, has proposed a bill demanding a US pullout.
Trump's latest remarks had made passing such a law "a national duty."
Deputy speaker of parliament Hassan Karim al-Kaabi, also close to Sadr, said they were a "new provocation", weeks after the US president sparked outrage in Iraq by visiting US troops at Ain al-Asad without meeting a single Iraqi official.
Officially, Iraq says there are no American bases on its soil - only instructors deployed at Iraqi bases.
Kurdish MP Sarkawt Shams tweeted that the mission of US troops in Iraq was "to help Iraqi security forces against terrorism, not 'watching' others."
"We are expecting the United States to respect Our mutual interests and avoid pushing Iraq into a regional conflict," he said.
Washington has had troops in Iraq since the 2003 US-led invasion that toppled dictator Saddam Hussein. At the height of its fight against insurgents, it had up to 170,000 US troops in the country, before a partial withdrawal starting in late 2011.