Iraq's outgoing prime minister on Tuesday called for American troops to leave the country to avoid further tensions between the United States and Iran that have reached a boiling point in recent weeks.

Adel Abdul-Mahdi's comments came days after Iranian Quds Force Gen. Qassem Soleimani was killed in a U.S. airstrike in Baghdad's airport. A senior Iraqi commander of an Iran-backed militia was also killed. The U.S. blamed Soleimani for the killing of hundreds of American troops and said he was plotting new attacks just before his death.

Iranian officials and President Trump have traded threats since Soleimani's death, and more U.S. troops have been deployed to the region amid heightened tensions. Iran-backed militias in Iraq, known as the Popular Mobilization Forces (PMF), have threatened revenge on American interests and personnel for the killings.

AFTER SOLEIMANI: CELEBRATIONS, CYBER-ATTACKS AND THREATS TO KICK US TROOPS OUT OF IRAQ

“We have no exit but this, otherwise we are speeding toward confrontation,” said Abdul-Mahdi said in a prerecorded televised speech following a weekly cabinet meeting.

On Sunday, Iraqi lawmakers approved a resolution to expel U.S. forces from the country. The resolution comes nearly five years after the government requested U.S. troops be deployed to Iraq after the Islamic State overtook vast swaths of the country.

The terror group has since been defeated, Abdul-Mahdi said, adding the mission has now evolved into a U.S.-Iran proxy war.

“Iraq did its part to fight in the war, and I see that any harm to Iraq will be harmful to all regional states and the whole world," the prime minister said.

TRUMP THREATENS IRAN WITH 'MAJOR RETALIATION' FOR FUTURE ATTACKS, WARNS IRAQ OF SANCTIONS IF US TROOPS OUSTED

Defense Secretary Mark Esper said Monday there are no plans to withdraw American troops from Iraq. His comments were a clarification of a letter sent to Iraqi authorities on Monday that said the U.S.-lead coalition would be “repositioning forces over the course of the coming days and weeks to prepare for onward movement.”

Many, including Iraqi lawmakers, interpreted the letter to mean the U.S. was withdrawing its forces. Abdul-Mahdi said Iraqi authorities were blindsided when American officials said the letter was sent in error.

“After four to five hours it was said that the letter was wrong. The letter clearly indicates a withdrawal," Abdul-Mahdi said. “So in the future, what should we do if we get such a request? We should check if it is authentic or not? If we are late, then they will tell us that we are late."

CLICK HERE FOR THE FOX NEWS APP

Abdul-Mahdi resigned in November following weeks of deadly anti-government protests against the country's political classes. A replacement has not been named.

The Associated Press contributed to this report.