Secretary of State Mike Pompeo made a surprise visit to Baghdad on Wednesday, with the U.S. diplomat adding a stop in Iraq to his eight-day tour of Middle East capitals.

In meetings that were widely covered by Iraqi TV and other media, Pompeo met with Iraqi Prime Minister Adel Abdul-Mahdi and President Barham Salih, along with Iraq's foreign minister and parliamentary speaker.

The secretary's trip has two goals: to reassure America's regional allies as President Trump's administration sends mixed messages about troop levels in Syria, and to rally support for a hardline stance against Iran.

Pompeo started his Mideast swing in Amman, Jordan, where he insisted that the U.S. decision to pull troops out of Syria would not diminish its ability to fight ISIS.

In Iraq, Pompeo and Abdul-Mahdi discussed plans to support Iraq's stability and security, as well as its energy independence, according to State Department Deputy Spokesperson Robert Palladino.

"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," Palladino said.

Much as when President Trump visited Iraq in December, U.S. officials took steps to keep details of the trip secret out of security concerns. The State Department did not include Baghdad when it released a list of cities Pompeo would visit. But there was speculation the visit would take place, after White House press secretary Sarah Huckabee Sanders said in December that Pompeo would visit Iraq this week.

Pompeo arrived in Baghdad in fairly low-key fashion, with U.S. ambassador to Iraq Douglas Silliman and Gen. Paul LaCamera of Combined Joint Task Force – Operation Inherent Resolve standing on the tarmac to greet Pompeo and his wife, Susan, as they got off their U.S. Air Force C-130. A small pool of four journalists accompanied the secretary's group.

"This is the first high-level meeting since President Trump flew in to see U.S. troops at an Iraqi airbase here at Christmas," NPR's Jane Arraf reports from Baghdad. "That visit was controversial here because Trump didn't visit Iraqi leaders while he was in the country."

Trump's trip angered some Iraqis, particularly after his planned visit with Abdul-Mahdi was canceled. At least one Iraqi politician called it a violation of Iraq's sovereignty, and the act of an occupier, not an ally.

Pompeo's visit seems to have gone smoothly, as he sat down with each of Iraq's four main leaders to discuss military and economic relations with the U.S. and plans for the future. The secretary did not take any questions from the press during his trip, and he did not appear alongside any of the Iraqi politicians for a formal news conference.

NPR's Diplomatic Correspondent Michele Kelemen contributed reporting to this story.

Copyright 2019 NPR. To see more, visit https://www.npr.org.