The US blamed Iran and Iran-backed militias for threats to its consulate in Basra and vowed unspecified retaliation. Basra has been hit by weeks of anti-government protests that have also targeted Iranian interests.
The United States on Friday effectively shut its consulate in the protest-hit Iraqi city of Basra and blamed Iran and Iran-backed militias for threats and attacks in recent weeks.
The decision comes as Tehran and Washington exchange bellicose language and the United States ramps up pressure on Iran, which is subject to mounting US sanctions.
US Secretary of State Mike Pompeo reiterated a threat to hold Iran directly responsible for any harm or attack on Americans or US facilities in Iraq or elsewhere, "whether perpetrated by Iranian forces directly or by associated proxy militias."
"I have made clear that Iran should understand that the United States will respond promptly and appropriately to any such attacks," Pompeo said in a statement.
The United States blames Iran-backed militia for "indirect fire," usually from rockets or artillery, on the US consulate at the Basra airport. It has provided no evidence to support the allegations.
There was a rocket attack earlier this month in the fortified Green Zone in Baghdad, where the US Embassy, parliament and government buildings are located. No US facilities have been hit in the attacks.
Pompeo said there were "increasing and specific threats and incitement" against US personnel and facilities in Iraq.
The consulate closure is temporary and involves relocating diplomatic personnel.
Oil-rich Basra, located in southern Iraq, has been the scene of anti-government protests in recent weeks by Iraqis fed up with poor services and corruption.
Read more: Iraq's protests: What you need to know
Analysts have said the protests mark a turning point in Iraq, as poor Shiites in the south target their anger at the Shiite political establishment that is nominally supposed to represent them. At least 15 protesters have been killed in clashes with security forces.
Protesters have repeatedly clashed with pro-Iranian Shiite militias that have fought the "Islamic State" (IS) and earlier this month Iran's consulate in Basra was stormed and torched.
Earlier, the Iranian Foreign Ministry called US allegations of inciting violence in Basra "astonishing, provocative and irresponsible."
Both the United States and Iran have strong influence in Iraq and have at times tacitly cooperated, whether in pushing back IS militants or seeking political stability in Baghdad.
The decision to temporarily close the US consulate in Basra comes after an attack on a military parade in Iran last weekend that the Islamic Republic blamed on the United States and its regional allies.
It also comes following heated exchanges at the UN General Assembly this week, where US President Donald Trump accused Iran of sowing "chaos, death and destruction" across the Middle East.
On Tuesday, Trump's hardline National Security Adviser John Bolton told an anti-Iran lobby group in New York that Iran would have "hell to pay" if it crossed the United States or its allies.
Iran accuses of the United States of pursuing regime change.
In May, Trump withdrew the United States from the 2015 international nuclear accord and is set to impose a second round of sanctions targeting Iran's oil trade in November. The sanctions have pummeled Iran's economy and currency.
Germany, France, Britain, Russia and China are trying to save the nuclear deal by providing Iran economic relief, adding to tensions between international powers and the United States as it ramps up pressure on Tehran.