Acting U.S. defense chief Pat Shanahan visited Iraq on Tuesday to talk with his commanders and the country’s leaders about the U.S. military’s presence there.

There are about 5,200 U.S. troops currently in Iraq on a mission to advise and train Iraqi security forces. Since 2014, there has also been a major focus on defeating the Islamic State group, which at one point held large areas of northern and western Iraq before Iraqi troops backed by U.S.-led coalition airstrikes reclaimed control.

“What’s important to remind everyone … or maybe just to reiterate is that we are in Iraq at the invitation of the government, and our interests are to build Iraqi security capability,” Shanahan told reporters traveling with him. “I wanted to hear firsthand from them about their concerns, the political dynamics that they’re facing and then, based on that, we’ll obviously factor that into our planning.”

President Donald Trump drew ire from Iraqi leaders earlier this month by saying it was important for U.S. troops to be in Iraq in order to monitor neighboring Iran.

Shanahan is set to take part in a meeting of NATO defense ministers this week in Brussels, and before going to Iraq made a stop in Afghanistan.