The US State Department ordered all "non-emergency US government employees" to leave Iraq, the American embassy in Baghdad said on Wednesday.
The embassy said it could provide only limited emergency services to US citizens. Normal visa services at US offices in Baghdad and Erbil would be suspended.
It called on US personnel to leave Iraq by commercial transport "as soon as possible" and to "avoid US facilities within Iraq".
The embassy advised those affected to review their personal security and be aware of their surroundings.
Germany's armed forces announced they would suspend training operations in Iraq on Wednesday because of increasing regional tension, Reuters reported.
On Monday, the US embassy advised citizens against all travel to Iraq, telling them to be vigilant and keep a low profile.
In September last year, the US withdrew its staff from the consulate in Basra after what it said was a greater threat from Iran and the militias it supports.
That followed rocket fire, which was thought to have targeted the embassy despite missing its target. Basra is in the south-east of Iraq, next to the Iranian border.
US Secretary of State Mike Pompeo made an unexpected trip to Baghdad last week to ensure the country could adequately protect Americans amid an increased threat from Iran.
"We talked to them about the importance of Iraq ensuring that it’s able to adequately protect Americans in their country," Mr Pompeo said after meeting Prime Minister Adel Abdul Mahdi.
US Central Command spokesman Capt Bill Urban said last week that there had been "indications that Iranian and Iranian proxy forces were making preparations to possibly attack US forces in the region".
The US has moved the USS Abraham Lincoln aircraft carrier and B-52 bombers to the Arabian Gulf.
The Pentagon has also made plans to move 120,000 troops to the region if Iran attacked US forces or advanced its nuclear weapons programme, The New York Times reported on Monday.
US Central Command said on Tuesday that there was an increased risk to American forces and allies from Iranian-backed militias in the region.
This disputed an assessment by a senior British general in the US-led mission to defeat ISIS, who suggested there was no increased threat from Iranian proxies.
"US Central Command, in co-ordination with Operation Inherent Resolve, has increased the force posture level for all service members assigned in Iraq and Syria," Capt Urban said.
"As a result, OIR is now at a high level of alert as we continue to closely monitor credible and possibly imminent threats to US forces in Iraq."
Maj Gen Chris Ghika, a deputy commander of the operation, earlier said he had not seen an increased threat from Iranian proxies.
On Sunday, the UK's Ministry of Defence said Gen Ghika's remarks were "based on day-to-day military operations and his sole focus is the enduring defeat of Daesh".
"The UK has long been clear about our concerns over Iran's destabilising behaviour in the region," it said.