WASHINGTON -- No one knows how seriously to take President Donald Trump’s threat to seize Iraq’s oil.

Doing so would involve extraordinary costs and risk confrontation with America’s best ground partner against the Islamic State of Iraq and Syria (ISIS), but the president told the CIA this weekend, “Maybe you’ll have another chance.”

The recycled campaign comment is raising concerns about Mr. Trump’s understanding of the delicate Middle East politics involved in the U.S.-led effort against extremist groups. Mr. Trump has said he was opposed to the 2003 invasion that toppled Saddam Hussein’s dictatorship. But on the campaign trail and again on Saturday, the day after his inauguration, he suggested the costly and deadly occupation of the country might have been offset somewhat if the United States had taken the country’s rich petroleum reserves.

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

Get Breaking News Delivered to Your Inbox

“So we should have kept the oil,” he said. “But, OK, maybe you’ll have another chance.”

The statement ignores the precedent of hundreds of years of American history and presidents who have tended to pour money and aid back into countries the United States has fought in major wars. The U.S. still has troops in Germany and Japan, with the permission of those nations, but did not take possession of their natural resources.

Taking Iraq’s reserves, the world’s fifth largest, would require an immense investment of resources and manpower in a country that the United States couldn’t quell after spending more than $2 trillion and deploying at one point more than 170,000 troops.

U.S. enemies and friends would oppose the move. While Iraqi Prime Minister Haider al-Abadi has accepted U.S. help to retake ISIS-held territory in his country, he has repeatedly asserted Iraqi sovereignty. He said of Mr. Trump’s oil vow in November, “I am going to judge him by what he does later.”

Asked about Mr. Trump’s comments, al-Abadi told an Iraqi television channel on Tuesday, “It wasn’t clear what he meant.”

“Did he mean in 2003 or to prevent the terrorists from seizing Iraq’s oil? It was not clear to us, but definitely Iraq’s oil is constitutionally the property of the Iraqis and anything on the contrary is unacceptable,” the Iraqi leader said. “I do not think that there is any official in the world who can claim something that he does not have.”

Asked about the matter on Monday, White House press secretary Sean Spicer stressed Mr. Trump’s economic argument.

“We want to be sure our interests are protected,” he told reporters. “We’re going into a country for a cause. He wants to be sure America is getting something out of it for the commitment and sacrifice it is making.”

There is uncertainty as to where Mr. Trump’s idea derives from, though the president has noted that taking the oil is something “I have long said.” Hints of this notion existed in some of the pre-2003 rhetoric from the Bush administration about the Iraq war “paying for itself.” But top advisers to President George W. Bush have stressed how the future of Iraq’s resources were pointedly left out of decision-making related to the invasion so as not to fuel a perception that the war was driven by oil concerns.

Bush “almost bent over backwards not to make a special effort to gain access for us to the oil resources,” John Negroponte, who was Bush’s director of national intelligence, told CNN.

Regarding Mr. Trump, former CIA Director and Defense Secretary Robert Gates told NBC, “I have no clue what he’s talking about.”

Taking the oil would require a permanent U.S. occupation, or at least until Iraq’s 140 billion barrels of crude run out, and a large presence of American soldiers to guard sometimes isolated oil fields and infrastructure. Such a mission would be highly unpopular with Iraqis, whose hearts and minds the U.S. is still try to win to defeat groups such as ISIS and al Qaeda.

“This is totally wrong,” said Zaher Aziz, a 42-year-old owner of a market stand in Irbil. “They came here by themselves and occupied Iraq. And now they want the Iraqis to pay for that?”

However unrealistic Mr. Trump’s suggestion, intelligence officials believe more has to be done to cut off ISIS oil revenues. The group seized significant oil when it stormed across Syria’s border in 2014 and seized the city of Mosul and large swaths of Iraqi territory. The Treasury Department estimated that ISIS raked in $500 million from oil and gas sales in 2015. That figure is likely lower now as a result of U.S.-led operations, but officials say oil continues to fund the group’s recruitment and far-flung terrorist activities.

“In terms of oil helping establish ISIS, of course that’s oversimplification,” said Hassan Hassan, co-author of the book “ISIS: Inside the Army of Terror.”

He said oil was a small part of the group’s “origins and early years,” when it morphed from an al Qaeda branch to an organization claiming a worldwide caliphate.