Donald Trump has had a fixation on Iraq’s oil—and America’s right to seize it—for at least six years. In 2011, he told a Fox News producer that the U.S. should “take the oil.” It was a common theme on the campaign trail last year. “We go in, we spent three trillion dollars. We lose thousands and thousands of lives, and then look what happens is we get nothing. You know, it used to be the victor belong the spoils,” Trump said on NBC’s “Today Show,” in September. “There was no victor there, believe me. There was no victory. But I always said, ‘Take the oil.’ ”

During his first week in office, Trump has twice repeated the claim—and alluded to a new opportunity to do just that. “Maybe you’ll have another chance,” he said, in unscripted remarks at the C.I.A., on his first full day in office. Four days later, ABC’s David Muir pressed him on what he meant. “We’re gonna see what happens,” the President said. “You know, I told you, and I told everybody else that wants to talk when it comes to the military, I don’t wanna discuss things.” The Administration is now reviewing options to be more aggressive, in both Iraq and Syria, against the Islamic State (ISIS).

The reaction, from Washington to Baghdad, has been outrage—and bewilderment. “What he’s talking about is theft, pure and simple,” Robert Goldman, a professor at American University who has taught the laws of war for four decades, told me. “We have no right, and never had a right, even as an occupier, to take their oil. So what he is talking about is patently illegal under the laws of war, under which we are bound.”

Trump’s statements have infuriated Iraqis—and added to the woes of the fragile government of Prime Minister Haider al-Abadi, the pivotal U.S. ally in the war against the Islamic State. Iraqi troops, backed by U.S. air power and military advisers, have retaken about sixty per cent of the Iraqi territory seized by the pseudo-caliphate in 2014.

“Iraq’s oil is for Iraqis, and any statement contradicting that is unacceptable,” Abadi countered at a press conference in Baghdad, last Tuesday. Another Iraqi official said that Trump’s suggestion amounted to “looting,” and questioned how the new Administration might do it. “Would he send the U.S. Navy to interdict tankers with Iraqi oil?”

Across the Middle East, Trump’s comments have revived accusations that the U.S. invasion of Iraq, in 2003, was always about petroleum—and that recent efforts to help are, too. Iraq is estimated to have the fifth-largest reserves in the world. I spoke to Hoshyar Zebari, who was Iraq’s first foreign minister after Saddam Hussein’s ouster, from 2003 to 2014, and its finance minister from 2014 until 2016. “This will be a rich menu for those conspiracy theorists in the Mideast and Islamic world who now say, ‘We told you so. They are only after your oil interests.’ It will inflate their imaginations further,” he told me. “They are already being recited on television programs in the region and the Islamic world.”

Laws of war are among the oldest in human history—they date back to Sun Tzu’s “The Art of War,” in the fifth century B.C., and are cited in the Old and New Testaments, the Koran, at least three Hindu texts, and a core text of Buddhism. During the American Civil War, Abraham Lincoln issued to Union soldiers the Lieber Code, the first formal national laws of war. It covered everything from the protection of civilians to pillaging. The Lieber Code influenced the 1907 Hague Convention, which outlines the obligations of and constraints on victorious armies that occupy foreign lands; it was embraced by all major powers at the time it was written. The 1949 Geneva Conventions, ratified by all United Nations members, deal largely with the protection of victims of armed conflict.

These two international treaties are still the principal texts setting out the rights and duties of an occupying power. They stipulate that a foreign military is basically a trustee that steps in to carry out the duties of the state. Article 47 of the Hague Convention stipulates, “Pillage is formally forbidden.” The other articles say that an occupying army can make temporary use of local fruits or profits, but only to cover its own needs or costs. The Convention does not allow a foreign government to claim ownership of the resources of the territory it occupies.

The United States has had three roles in Iraq: in 2003, after the ouster of President Saddam Hussein, the U.S. proclaimed itself an occupying power. In 2004, limited sovereignty was transferred to an Iraqi caretaker government. In 2005, when Iraq wrote a new constitution and elected its first parliament, the United States remained in the country, conducting military operations at the invitation of the elected government but no longer serving as an occupier. U.S. troops were withdrawn in 2011. There then was a three-year absence. Since 2014, U.S. troops have been deployed in steadily increasing numbers—some five thousand now—largely as advisers and trainers to help the Iraqi Army fight ISIS militants. American military personnel are not now in combat roles, nor acting as an occupying force.

None of these disparate roles have provided a legal basis for the United States to claim Iraq’s oil outright, according to legal experts, as well as current and former U.S. officials.

“It would have been unlawful for the U.S. to take Iraq’s oil resources to benefit the United States during the occupation, and it would be even more clearly unlawful to try to take Iraqi oil now that Iraq has returned to full sovereignty,” John B. Bellinger III, the chief legal adviser to the State Department and the National Security Council during the George W. Bush Administration, told me.

Legally, an occupying army can make limited and tightly defined claims to income from national assets. “Yes, you can use some of a country’s oil revenues, but you step into the shoes of the former government and you have a responsibility to keep the lights on, keep the police functioning, and so on,” Goldman, the American University professor, told me. “So you could take certain things to defray costs, but not to the detriment or the impoverishment of the people.”

The Bush Administration, Bellinger said, decided that Iraq’s oil would be used only for the benefit of the Iraqi people. U.S. companies had to compete with other foreign corporations for Iraqi oil contracts.

The White House has yet to clarify President Trump’s thinking or intentions. “We want to be sure our interests are protected,” Sean Spicer, the White House press secretary, 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.”

But the legal scholars I consulted challenged this interpretation. “The issue is complicated in its details, but basically what Trump has in mind—pillaging during occupation—is prohibited,” Jack Goldsmith, a Harvard Law School professor who served in the Bush Administration’s Justice Department, told me.

The President has also made a connection between Iraq’s oil and the rise of ISIS. “If we kept the oil, you probably wouldn’t have ISIS, because that’s where they made their money in the first place,” Trump told intelligence officers at the C.I.A. “So we should have kept the oil.”