Baghdad -- U.S. Secretary of State Mike Pompeo made an unannounced stop in Iraq on Wednesday amid confusion over changing messages from the Trump administration about a planned U.S. troop withdrawal from Syria. Pompeo met senior Iraqi leaders, including Prime Minister Adil Adb al-Mahdi and President Barham Salih, whom he reassured that the United States was committed to not only defeating ISIS in the region, but making sure the terror group cannot rebuild itself after the fighting stops.

During a meeting with the speaker of the Iraqi Parliament, Mohamed al Halbousi, Pompeo said the U.S. and Iraq had "worked closely together to take down Daesh," using the Arabic acronym for the terror group. "You should know the U.S. stands by to make sure that the resurgence of Daesh doesn't take place."

Speaking to President al-Mahdi, Pompeo "discussed the recent territorial defeat of ISIS in Syria and the continuation of our cooperation with Iraqi Security Forces to ensure ISIS' lasting defeat throughout the region," according to a readout of the meeting provided by Deputy Spokesperson Robert Palladino.

Get Breaking News Delivered to Your Inbox

Mr. Trump made his own unannounced visit to Iraq on Dec. 26, saying the U.S. could use its bases in Iraq as a platform for continued operations in Syria. He didn't meet with any Iraqi officials, which angered both Iraqi politicians and militia leaders who have worked with the U.S.

President Trump stunned U.S. allies and lawmakers on both sides of the aisle in Washington last month when he announced that ISIS was defeated and all 2,000 American troops in Syria were, "coming back now."

Amid the backlash against the move, which included former Secretary of Defense James Mattis announcing his resignation, Mr. Trump's national security adviser John Bolton said last weekend that there were in fact two criteria which must be met before the U.S. will pull its troops out of Syria; the complete defeat of ISIS and the guaranteed safety of U.S.-allied Kurdish forces in Syria.

Although Mr. Trump insisted on Monday that he hadn't changed his mind about pulling troops out of Syria, CBS News senior national security correspondent David Martin said the new withdrawal timetable is dramatically different: When Mr. Trump first made the announcement it was 30 days, then it stretched to 120, but with Bolton's remarks it was clear the commitment had become open-ended.

There has been no indication from the Trump administration of any plans to pull the much larger U.S. military contingent in Iraq out of the country, but a withdrawal from neighboring Syria, given the two nations' long shared border, would be of significant concern to Baghdad.

Secretary of State Mike Pompeo meets with Iraq's President Barham Salih in Baghdad, Jan. 9, 2019. Getty

Iraqi President Salih was asked by reporters on Wednesday as he met with Pompeo, who ignored a similar question, if he wanted U.S. troops to remain in his country.

"We will need the support of the United States," he said, adding that one of the purposes of his meeting with Pompeo was, "to express gratitude to the U.S. for support over the years, certainly."

"ISIS is defeated -- but the mission is not over," Salih said.