His comments appeared to be a departure from President Donald Trump, who since taking office has made controversial comments about Iraq and its oil.
A day after his inauguration, Trump said about Iraq: "We should have kept the oil. Maybe we'll have another chance." He repeated the comments a few days later in an interview with ABC's David Muir
: "We should have taken the oil. You wouldn't have ISIS if we took the oil."
Trump has said the US has spent trillions of dollars fighting ISIS but that the effort could have been avoided if Americans had just co-opted the terrorists' oil supply after the US invasion. Critics have said taking Iraq's oil would have amounted to stealing from civilians and thus been a war crime and a violation of international law.
On Monday, Mattis offered a different perspective from the president.
"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 so in the future. We're not in Iraq to seize anyone's oil," said Mattis, a retired four-star general.
War on ISIS
Mattis told reporters in Abu Dhabi, in the United Arab Emirates, that he was heading to Baghdad "because I need to get current on the situation there, the political situation, the enemy situation and the friendly situation." The trip had not previously been announced.
Mattis said he wants to speak with the Iraqi political leadership and US partners: "We're going to make certain we've got good shared situational awareness of what we face as we work together, fight alongside each other to destroy ISIS. That's the point about going in there."
On Sunday, Iraq launched a new offensive to regain control
of western Mosul from ISIS. The operation comes weeks after Iraqi forces recaptured eastern Mosul across the Tigris River.
Since October, a coalition of Iraqi-led forces has pushed to end ISIS' brutal rule in the country's second-largest city. The US-led coalition has played a supporting role with advisers and assistance with airstrikes.
Mattis met with US and coalition leaders from Australia, Canada and the UK after arriving in Baghdad.
Mattis and other US senior leaders are under a deadline to come up with a plan to defeat ISIS. On January 28, Trump signed an executive order
calling for the defense secretary to submit within 30 days a draft of a new plan to defeat ISIS.
Effects on Iraqi immigrants
Mattis also was asked about the possibility the Trump administration would sign a new executive order on immigration.
Trump's order blocks travelers
from seven Muslim-majority countries, including Iraq, from entering the US for 90 days and stops refugees from coming in for four months. Among those affected are people who applied for asylum in the US after helping US forces in Iraq as translators and contractors -- a consequence some US veterans have condemned.
Within a week of being signed, a federal judge halted Trump's action; an appeals court panel affirmed the decision.
"I have not seen the new executive order," Mattis said, "but I, right now, am assured that we will take steps to allow those who have fought alongside us, for example, to be allowed into the United States."
"They will have been vetted, obviously, by their performance on the battlefield beside us and by the normal procedures, and I'm sure we will work our way through this quickly."