BAGHDAD — Defense Secretary Jim Mattis said Monday the United States does not intend to seize Iraqi oil, shifting away from an idea proposed by President Donald Trump that has rattled Iraq's leaders.

Mattis arrived on an unannounced visit in Iraq as the battle to oust ISIS militants from western Mosul moved into its second day, and as the Pentagon considers ways to accelerate the campaign against the group in Iraq and Syria.

Those efforts could be complicated by Trump's oil threat and his inclusion of Iraq in the administration's travel ban — twin blows that have roiled the nation and spurred local lawmakers to pressure Prime Minister Haider al-Abadi to reduce cooperation with Washington.

"I think all of us here in this room, all of us in America have generally paid for our gas and oil all along, and I'm sure that we will continue to do that in the future," Mattis told reporters traveling with him. "We're not in Iraq to seize anybody's oil."

Mattis' remarks on oil are the latest example of his policy differences with Trump. Trump has acknowledged that Mattis did not agree with him about the usefulness of torture as an interrogation tactic but said he would defer the matter to his defense secretary.

Mattis has also taken a dimmer view of Russia and President Vladimir Putin than Trump, saying Moscow sought to break the NATO alliance. On Sunday, Mattis distanced himself from Trump's labeling of the media as "the enemy of the American people," saying he had no problems with the press.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

His comments may provide some reassurance to the Iraqis. But the tensions come at a critical point in the war against ISIS, with two key battles in the works: the fight to take control of west Mosul, and the start of a campaign in Syria to oust ISIS from Raqqa, the capital of its self-declared caliphate.

Al-Abadi has taken a measured approach, but the issues can roil already difficult internal politics.

Under the president's deadline, Mattis has just a week to send Trump a strategy to accelerate the fight and defeat ISIS. And any plan is likely to depend on U.S. and coalition troops working with and through the local forces in both countries.

"We're going to make certain that we've got good situational awareness of what we face as we work together and fight alongside each other," said Mattis, a retired Marine general wary of Iranian influence in Iraq.

His key goal during the visit is to speak about the military operations with political leaders and commanders on the ground, including his top commander in Iraq, Lt. Gen. Stephen Townsend.

Asked about the tensions, Mattis said he has been assured that the travel ban — it has been stalled by a legal challenge — would not affect Iraqis who have fought alongside U.S. forces.

The oil issue, however, may be more difficult. Trump brought it up during the campaign, and he mentioned it again late last month during a visit to the CIA.

"To the victor belong the spoils," Trump told members of the intelligence community. He said he first argued this case for "economic reasons," but added it made sense as a counterterrorism approach to defeating ISIS "because that's where they made their money in the first place."

"So we should have kept the oil," he said. "But, OK, maybe you'll have another chance."

Trump, however, has also been clear that defeating ISIS is a top priority. In his inauguration address, he pledged to eradicate radical Islamist terrorism "completely from the face of the Earth." And he talked during the campaign about greatly increasing the number of U.S. troops in order to "knock out" ISIS.

He signed an order Jan. 28 that gives Mattis and senior military leaders 30 days to come up with a new plan to beef up the fight.

There are more than 5,100 U.S. forces in Iraq, and up to about 500 in Syria.