President Trump Sunday said the United States would not abandon its airbase in Iraq unless the country paid billions for the cost of building it.

"We're not leaving unless they pay us back for it," Trump told reporters aboard Air Force One as it flew from his home in Palm Springs, Florida, back to Washington.

“We have a very extraordinarily expensive airbase that’s there. It cost billions of dollars to build. Long before my time. We’re not leaving unless they pay us back for it," he said.

Iraq's parliament Sunday voted in favor of expelling U.S. troops from the country in response to the killing last week of top Iranian Gen. Qassem Soleimani. It is not clear how Iraq will proceed in the wake of the vote.

The president did not specify the airbase, but he was presumably referencing the al-Asad Airbase in Anbar province, which he has previously said cost the United States a "fortune" to build. The base was originally built by the Iraqis, but the United States made investments to improve it after ousting Saddam Hussein in 2003.

Trump said the U.S. would inflict crippling sanctions on Iraq if it forced U.S. troops to depart.

“If they do ask us to leave, if we don’t do it on a very friendly basis, we will charge them sanctions like they’ve never seen before ever. It’ll make Iranian sanctions look somewhat tame,” he said. “If there’s any hostility, that they do anything we think is inappropriate, we are going to put sanctions on Iraq, very big sanctions on Iraq."

Trump emphasized that he is not happy that the U.S. is in Iraq in the first place.

"I told you, Iraq was the worst decision, going into the Middle East was the worst decision ever made in the history of our country, and I've said that publicly, so I guess I can say that right now: Going into the Middle East was the worst decision ever made in the history of our country," he said. "But, we are there, and they went into Iraq."

[Read more: Trump warns Iran of 'major retaliation' if it responds to Soleimani killing]