BAGHDAD (AP) — The top Pentagon official assured Iraqi leaders Tuesday that the U.S. will stick to its limited military role in Iraq, a message aimed at recent talk by some Iraqi politicians of forcing a U.S. troop withdrawal.

Pat Shanahan, the acting secretary of defense, said that in talks with Prime Minister Adel Abdul-Mahdi, he stressed U.S. respect for Iraqi sovereignty, an issue that has become a hot-button topic among Iraqis since President Donald Trump suggested using Iraq as a base for monitoring neighboring Iran and for potential attacks against remaining elements of the Islamic State group in Syria.

"I wanted to make clear to him (Abdul-Mahdi) that we recognize our role," Shanahan told reporters later after he flew to Brussels, Belgium. "We understand that we're there by invitation, and that we jointly share the resources and that we clearly recognize their sovereignty."

Shanahan said he did not raise the possibility of moving additional U.S. troops into Iraq to offset the coming withdrawal of American forces from Syria. The U.S. has about 5,200 troops in Iraq as trainers and advisers to Iraqi security forces in their battle against insurgent elements of the Islamic State group that once controlled large swaths of Iraqi territory. He said they discussed "how we can generate more capacity and capability in the Iraqi security forces."

Shanahan, who had not previously been to Iraq and is on the second leg of his first international trip as the acting Pentagon chief, said he was mindful of Iraqi parliamentary proposals to "restrict the number of U.S. forces in Iraq." He said he also emphasized to Abdul-Madhi the role security plays in Iraq's economic future.

"We really talked about that economic security," Shanahan said.

Trump upset Iraqis by saying earlier this month that U.S. forces should use their Iraqi positions to keep an eye on neighboring Iran. That is not the stated U.S. mission in Iraq, and Iraqi officials have said Trump's proposal would violate the Iraqi constitution.

Trump also has angered Iraqi politicians by arguing that he would keep U.S. troops in Iraq and use the country as a base from which to strike extremists in Syria if necessary, after the 2,000 troops now in Syria depart in coming weeks.

Curbing foreign influence has become a prominent topic in Iraq after parliamentary elections last year in which Shiite politicians backed by Iran made significant gains. Meanwhile, Shiite militias that fought alongside U.S.-backed Iraqi government troops against IS in recent years, gained outsized influence along the way.

U.S. forces withdrew from Iraq in 2011, but they returned in 2014 at the invitation of the government to help battle the Islamic State group after it seized vast areas in the north and west of the country, including Iraq's second largest city, Mosul. A U.S.-led coalition provided crucial air support as Iraqi forces regrouped and drove IS out in a costly three-year campaign.

Now, after defeating IS militants in their last urban bastions, Iraqi politicians and militia leaders are increasingly speaking out against the continued presence of U.S. forces. Some Iraqi lawmakers are working on a draft bill calling for the withdrawal of the more than 5,000 U.S. troops from the country.

This political tension formed the backdrop to Shanahan's visit. He took over as the acting Pentagon chief after Jim Mattis resigned as defense secretary in December. It's unclear whether Trump will nominate Shanahan for Senate confirmation.

On Monday, Shanahan was in Afghanistan, where he met with U.S. troops and President Ashraf Ghani amid a U.S. push for peace talks with the Taliban. Trump has indicated he would like to get U.S. troops out of Afghanistan after 18 years of war, but Shanahan said he has no orders for a troop drawdown.

Although Afghanistan is America's longest war, fighting in Iraq has taken a heavier toll on American lives. President Barack Obama pulled troops out of Iraq in December 2011 but sent them back in smaller numbers in 2014 after the Islamic State group swept across the border from Syria and took control of much of western and northern Iraq.

Since the height of its self-proclaimed caliphate that included a third of both Iraq and Syria, IS-held territory has now shrunk to a sliver of territory in eastern Syria where remaining Islamic State militants are fighting back.

Trump has not publicly called for a U.S. withdrawal from Iraq, although he often calls the 2003 invasion a colossal mistake and has said the U.S. should have taken Iraq's oil as compensation for getting rid of Saddam.

Online Public Information File

Viewers with disabilities can get assistance accessing this station's FCC Public Inspection File by contacting the station with the information listed below. Questions or concerns relating to the accessibility of the FCC's online public file system should be directed to the FCC at 888-225-5322, 888-835-5322 (TTY), or fccinfo@fcc.gov.