US President Donald Trump announced on Wednesday that the last American forces had left Iraq, saying the time had come for US troops to return home as the US-led military mission against ISIS in Iraq came to an end.

In a post on Truth Social, Trump described the withdrawal as the conclusion of a long period of US military involvement in Iraq, arguing that Washington had made what he characterized as poor decisions that drew the country into what he called a “swamp.”

Trump also praised Iraqi Prime Minister Ali al-Zaidi, describing him as a “wonderful” prime minister and saying he had supported him from the beginning. He highlighted al-Zaidi’s election victory, which he said had been unexpected and achieved by a wide margin.

The US president characterized the end of the mission as a “victory for the United States and Iraq” and the conclusion of the campaign against ISIS, saying the group no longer had what he referred to as a “caliphate.”

Trump also compared the Iraq withdrawal with the US exit from Afghanistan, pointing to military equipment left behind there as well as American casualties during that withdrawal.

He said the departure of US troops and equipment from Erbil Air Base had been carried out in an orderly manner, describing it as the end of a costly and lengthy military chapter and reiterating that he had ultimately decided it was time for American forces to return home.

Washington and Baghdad had previously agreed to end the US-led coalition’s military mission against ISIS in Iraq, with Iraqi security forces assuming greater responsibility for counterterrorism operations.