Iraqi MPs have passed a non-binding resolution calling for foreign troops to leave, after the US killed Iranian general Qasem Soleimani in a drone strike at Baghdad airport last week.
Some 5,000 US soldiers are in Iraq as part of the international coalition against the Islamic State (IS) group.
The coalition paused operations against IS in Iraq just before Sunday's vote.
In another development, Iran announced it was removing all limits on its enrichment of uranium.
The move further distanced Tehran from an agreement struck with the US and other world powers in 2015 aimed at preventing it developing nuclear weapons.
Soleimani's killing marks a major escalation in tensions between Tehran and Washington, which pulled out of the nuclear agreement in 2018.
Under Soleimani's leadership, Iran had bolstered Hezbollah in Lebanon and other pro-Iranian militant groups, expanded its military presence in Iraq and Syria, and orchestrated Syria's offensive against rebel groups in the country's long civil war.
What impact is the killing having on Iraq?
Iraq finds itself in a difficult position as an ally both of neighbouring Iran, which is demanding revenge for Soleimani's assassination on Iraqi soil, and of the US.
US forces were invited to return to Iraq in 2014 to help defeat IS, and the Baghdad government sees the killing of Soleimani as a violation of the terms of the coalition's presence.
At the same time, some Iraqis resent Iranian influence in their country, accusing Iran of complicity in governance failure and corruption.
But there are concerns that parts of Iraq's population sympathetic to Iran have been alienated by Soleimani's killing, and that pro-Iranian militant groups may seek revenge.
Thousands of Iraqis attended a funeral procession for the Iranian general on Saturday before his body was flown to Iran.
The resolution was passed by the Iraqi parliament after caretaker Prime Minister Adel Abdul Mahdi called for an end to the foreign military presence in a speech to MPs.
- Calls on the government to revoke its request for assistance from the international coalition fighting IS due to "the end of military operations in Iraq and the achievement of victory"
- Says "the Iraqi government must work to end the presence of any foreign troops on Iraqi soil and prohibit them from using its land, airspace or water for any reason"
- Tells the government to file a formal complaint to the UN against the US "for its serious violations and breaches of Iraqi sovereignty and security"
Ahead of the vote, the prime minister said the US military presence in the country should be ended as soon as possible to reorganise "healthier and correct relationships with the US and the rest of the states".
How was Soleimani killed?
The Iraqi prime minister revealed he had been due to meet Soleimani on Friday, the day he was killed along with six others when their vehicles were hit by missiles as they were leaving Baghdad airport.
The Iranian commander had reportedly flown in from Lebanon or Syria in the early hours of that morning.
"I was scheduled to meet martyr Soleimani at 08:30 in the morning," the prime minister said on Sunday.
"He was killed because he was set to deliver a response from Iranians to a Saudi message, which we delivered to the Iranians to reach an important breakthrough in the situation in Iraq and the region."
Also killed along with Soleimani was Abu Mahdi al-Muhandis, an Iraqi who had commanded the Iranian-backed Kataib Hezbollah group.
How dangerous is the situation?
Operation Inherent Resolve, as the international coalition is formally known, announced it was halting operations against IS in order to protect US, UK and other foreign troops based in Iraq.
It pointed to repeated rocket attacks over the last two months which it blamed on Kataib Hezbollah.
"We remain resolute as partners of the government of Iraq and the Iraqi people that have welcomed us into their country to help defeat Isis [IS]," it said.
The US has advised its citizens to leave Iraq and deployed an extra 3,000 military personnel to the Middle East.
President Donald Trump has starkly warned Iran that any revenge attack on its citizens or assets will be met with American retaliation.
Analysts say Iran could deploy cyber-attacks against the US, or attempt to strike US military targets or interests in the Middle East.
What is happening in Iran?
Hundreds of thousands turned out in Iran on Sunday to give the dead general a hero's welcome ahead of his funeral on Tuesday.
When his coffin arrived in the southern city of Ahvaz, where he had served during the Iran-Iraq war (1980-88), mourners beat their chests and wailed.
The coffin, draped in the national flag, passed slowly though the crowds.
There were similar scenes in the Shia Muslim holy city of Mashhad.
Iran's priority is to cement Qasem Soleimani's status as a national hero, to ensure he remains powerful in death as in life, says Lyse Doucet, the BBC's chief international correspondent.
What efforts are being made to defuse the crisis?
German Foreign Minister Heiko Maas has said he will seek direct talks with Iran to try to de-escalate tensions.
UK Foreign Secretary Dominic Raab urged Iran to "take a diplomatic route" to reduce tensions.
Mr Raab said the UK understood why the US had killed Soleimani, and said the US "had a right to exercise self-defence". However, the UK wanted to "de-escalate tensions" and avoid "a major war", he added.
In Rome, Pope Francis called for dialogue and restraint, saying that "in many parts of the world the terrible air of tension is felt".
"War only brings death and destruction," the Roman Catholic leader said in his weekly address in St Peter's Square. "I call on all sides to keep the flame of dialogue and self-restraint alight."