Iraqi MPs have passed a resolution calling for foreign troops to leave the country after the US killed top Iranian general Qasem Soleimani in a drone strike at Baghdad airport last week.
Parliament in Baghdad also called for a ban on foreign forces using Iraqi land, airspace or water for any reason.
The US has some 5,000 military personnel in Iraq, mainly as advisers.
Thousands of Iraqis attended a funeral procession for Soleimani before his body was flown to Iran.
Iraq finds itself in a difficult position as an ally both of neighbouring Iran and of the US. Thousands of US troops remain in the country to assist in the broader struggle against the Sunni Muslim Islamic State (IS).
But the government sees the killing as a violation of its sovereignty, and of the terms of the coalition presence in Iraq.
Meanwhile, a variety of Shia Muslim militia groups in Iraq are supported by Iran, and there are concerns that parts of Iraq’s population sympathetic to Iran have been alienated by the killing, and that militant groups may seek revenge.
Iraq’s parliament met as hundreds of thousands of people turned out in Iran to mourn Soleimani.
The non-binding resolution was passed by the Iraqi parliament on Sunday after the caretaker Prime Minister, Adel Abdul Mahdi, called for an end to the foreign military presence in a speech to MPs.
Calls for revenge have multiplied in Iran since Soleimani’s assassination, which has thrown US foreign policy in the Middle East into question.
What does the resolution say exactly?
It 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”.
It 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”.
Furthermore, the government must 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.
Ending the US military presence in Iraq was “better for reorganising healthier and correct relationships with the US and the rest of the states”, Mr Abdul Mahdi said.