WASHINGTON — The U.S. will keep a military presence in Syria until Iran withdraws its forces, a top Trump administration official said Monday.

“We’re not going to leave as long as Iranian troops are outside Iranian borders, and that includes Iranian proxies and militias,” White House national security adviser John Bolton said while in New York for the U.N. General Assembly.

The pledge comes as 2,200 U.S. troops serve in Syria, nearly all of them devoted to the war against the Islamic State in the eastern third of the country. While Bolton and Secretary of State Mike Pompeo have said Iran poses the bigger strategic threat, U.S. military leaders have emphasized that Iran is not their focus.

Defense Secretary Jim Mattis, in a gathering with reporters at the Pentagon Monday, repeatedly asserted that Bolton’s comments reflected no change in policy, and that the Pentagon was on the same page as the White House on what the role for U.S. forces would be in Syria.

“As part of this overarching problem, we have to address Iran,” Mattis said. “Everywhere you go in the Middle East where there’s instability you will find Iran. So in terms of getting to the end state of the Geneva process, Iran, too, has a role to play, which is to stop fomenting trouble.

“Right now our troops inside Syria are there for one purpose, and that’s under the U.N. authorization about defeating ISIS,” Mattis said.

Mattis said he and Bolton were “on the same sheet of music,” but suggested the U.S. presence would be based on United Nations-led peace talks rather than Iran’s activities.

“It’s the Geneva process and the Geneva process has got to come to a conclusion if we are to see this end,” Mattis said.

The Trump administration has sought to partner with Russia in an effort to compel the Iranians to leave Syria, to no avail. In a new setback, Moscow announced it would give Syria’s government more modern, S-300 missile defense systems after last week’s downing of a Russian plane by Syria in a friendly fire incident — a topic Pompeo said he would bring up with his Russian counterpart this week.

“We think introducing the S-300s to the Syrian government would be a significant escalation by the Russians and something that we hope, if these press reports are accurate, they would reconsider,” Bolton said.

But the incident has stoked tensions between Russia and Israel, which Moscow blames for the incident. The Russian Ministry of Defence claims the down Russian IL-20 was caught in the crossfire as Syrian air defenses responded against Israeli F-16s.

Iran’s intervention in Syria on behalf of and at the invitation of Syrian President Bashar Assad has empowered a range of pro-Assad regime armed groups, including Lebanese Hezbollah, and has brought Iranian forces into Syria that Israel views as directly threatening its security, according to a Congressional Research Service report published this month.

President Donald Trump said five months ago he wanted to "get out” of Syria and bring U.S. troops home soon. But earlier this month, the secretary of state’s special representative for Syria engagement, James Jeffrey, offered comments suggesting U.S. forces could pursue an enduring presence in part to complicate Iranian activities in Syria.

Jeffrey said the administration intends to keep U.S. military forces in Syria beyond “the end of the year” to ensure the defeat of the Islamic State. “That means we are not in a hurry,” he said.

The Associated Press contributed to this report.