Iraq's parliament has voted to expel the US military from the country.

Lawmakers voted Sunday in favour of a resolution that calls for ending foreign military presence in the country. The resolution's main aim is to get the US to withdraw some 5,000 US troops present in different parts of Iraq.

The vote comes two days after a US airstrike killed Iranian Gen. Qassem Soleimani inside Iraq, dramatically increasing regional tensions.

The Iraqi resolution specifically calls for ending an agreement in which Washington sent troops to Iraq more than four years ago to help in the fight against the Islamic State group.

The resolution was backed by most Shiite members of parliament, who hold a majority of seats.

Many Sunni and Kurdish legislators did not show up for the session, apparently because they oppose abolishing the deal.