Secretary of State Mike Pompeo made an unannounced visit to Iraq on Wednesday, meeting with the Iraqi prime minister, Kurdish officials and other government leaders in a bid to demonstrate the United States’ support for a key ally.

Pompeo’s visit is part of a Middle East tour in which the secretary is seeking to reassure U.S. partners in the region after President Trump’s abrupt decision last month to withdraw troops from Syria. Pompeo is promising allies that the troops’ departure will not alter the U.S. mission to push back against Iran and oversee the complete defeat of the Islamic State, a prospect many in the region are now questioning.

His stop in Baghdad came amid speculation among Iraqi officials that the White House will also begin to draw down the 5,200 American military personnel based in Iraq in view of the defeat of the Islamic State on the ground in late 2017.

Pompeo said that he discussed Trump’s decision on Syria with the Iraqi leaders but that the focus of the meetings was on strengthening Iraq’s government to prevent an Islamic State resurgence and to beat back Iran’s significant influence in the country.

There was “a common understanding that the battle against Daesh, to counter Daesh, and the fight to counter Iran, is real and important,” he said after leaving Baghdad and arriving in Irbil, the capital of the semiautonomous Iraqi Kurdish region. Daesh is an Arabic acronym for the Islamic State.

U.S. officials have scrambled to contain the fallout from Trump’s directive for U.S. troops to leave Syria. Pompeo’s tour began in Jordan on Tuesday and will take him to Egypt, Bahrain, Qatar, the United Arab Emirates, Saudi Arabia, Kuwait and Oman. A key aspect of the U.S. withdrawal, protecting the U.S.-aligned Syrian Kurds from Turkish forces, appeared in jeopardy this week when Turkey lashed out at national security adviser John Bolton during his visit to the region.

Pompeo told reporters Wednesday that progress was being made in addressing Turkey’s objections to Kurdish militants in northeastern Syria and that Ankara had made “commitments” that the Kurds who fought with U.S. forces against the Islamic State would be protected.

The secretary’s stop in Iraq comes two weeks after Trump made a surprise visit to U.S. troops based in western Iraq the day after Christmas. That hastily planned trip was criticized by many Iraqis for its failure to include a meeting with the country’s leadership.

Trump’s visit, which supporters and opponents of the U.S. presence in Iraq criticized as undermining Iraq’s sovereignty, led to renewed calls by several lawmakers for American forces to leave Iraq. Many of them are part of a pro-Iranian bloc in parliament.

Pompeo met in Baghdad with Prime Minister Adel Abdul Mahdi, President Barham Salih, parliament Speaker Mohamed al-Halbousi and Foreign Minister Mohamed al-Hakim and expressed his support for their new government, which was partially formed in late September.

He also met with a group of U.S. troops after landing at Baghdad International Airport on Wednesday morning.

Pompeo ignored questions shouted by reporters traveling with him about the planned U.S. withdrawal from Syria and the administration’s commitment to keeping forces in Iraq. When Salih was asked whether he wants American troops to stay in Iraq, he said: “We will need the support of the U.S.”

“ISIS is defeated militarily, but [the] mission is not accomplished,” he added, according to a pool report. ISIS is an English acronym for the Islamic State.

Mahdi said Pompeo had assured him that the U.S. troop withdrawal from Syria would be gradual and done in coordination with the Iraqi government.

Iraqi military officials have voiced concern that any reduction of U.S. forces in Syria will affect Iraq’s improving security environment, given the long border the two countries share. Iraq routinely conducts airstrikes against Islamic State targets in Syria, and Mahdi said Tuesday that he has not ruled out Iraqi ground operations across the border.

According to a statement issued by the State Department, “the Secretary also 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.”

Pompeo also discussed energy independence, the statement said, a strategy the Trump administration sees as a key means of countering Iranian influence in Iraq.

Iraq relies heavily on Iranian gas to power its electricity plants, and Washington has twice granted Baghdad waivers from penalties stemming from U.S. sanctions reimposed on Iranian energy exports. But the White House has also pressed Iraq to turn to U.S. companies to develop its energy sector.

John Hudson in Abu Dhabi and Mustafa Salim in Baghdad contributed to this report.