The U.S. military mission in Syria includes defending Kurdish-run oil fields from Russia and Syria as well as ISIS, senior Pentagon leaders said, raising further questions about the future of a mission former officials say was already on shaky legal footing.

The “fundamental purpose” of securing the oil fields is to prevent ISIS from claiming them from the U.S.-allied, Kurdish-led Syrian Democratic Forces, Joint Chiefs of Staff Chairman Mark Milley told Pentagon reporters during a brief press conference on Monday.

Asked if that mission includes denying access to the Syrian regime and its Russian backers, “the short answer is yes,” Defense Secretary Mark Esper said.

“It presently does because in that case we want to make sure the SDF does have access to the resources in order to guard the prisons [of ISIS fighters], in order to guard their own troops, in order to assist us with the defeat-ISIS mission,” Esper said.

Legally—under both international law and domestic law—the United States is in Syria only to fight ISIS. At home, the U.S. relies on congressional authorizations passed in the wake of the Sept. 11 attacks to prosecute the war on ISIS. Internationally, the justification for the U.S.’s incursion into Syria is a 2014 request from Iraq for collective self-defense against ISIS.

But Trump put an extreme strain on the legal justification for the oilfields mission on Saturday, when he told reporters at the White House that the United States “should be able to take some.”

“[W]hat I intend to do, perhaps, is make a deal with an ExxonMobil or one of our great companies to go in there and do it properly,” he said.

Former defense officials and legal analysts say would be patently illegal under both domestic and international law.

Esper’s remarks on Monday that the mission encompasses Russia and Syria further strain the legal explanation for the mission, analysts say.

“Protection against Russian and Assad regime forces where U.S. forces are on the ground would fall under inherent self-defense authorities, and is entirely appropriate,” said Brett McGurk, the former State Department envoy for defeating ISIS, who resigned in protest in December over the Trump administration’s Syria strategy. “Being on the ground for the express purpose of denying those countries access to natural resources, however, would likely require a new legal basis, as it does not fall under the 2001 AUMF.”

Sen. Lindsey Graham, R-S.C., has also hinted that the oilfield mission is broader than denying access to a reconstituted ISIS. After a briefing with Pentagon leaders last week, he told reporters that the Pentagon was developing a plan that “may give us what we need to prevent ISIS from coming back, Iran taking the oil, ISIS from taking the oil.”

There is no congressional authorization for direct or sustained military action against Iran.

Even seen through a strictly counter-ISIS lens, using U.S. military assets to safeguard the oil fields on behalf of the SDF is on a “wafer-thin legal basis,” said one former defense official, because the SDF is itself not a sovereign nation. From the Syrian perspective, “seizing state territory, giving territory to a non-state paramilitary,” the former official said, “would be like the U.K. aiding the Confederacy in 1862.”

“I’m not saying the SDF relationship is wrong, per se,” the former official said. “I’m saying it gets ugly when we talk about the long-term purpose of these oilfields.”

Robert Chesney, a national security professor at the Texas University School of Law, said it is “definitely an issue if the mission is to keep Syria or Russia out of the oil fields, as opposed to keeping IS out.”

“Anything that has no real relationship to fighting the Islamic state or Al-Qaeda raises a question regarding the legal basis for using military force there,” Chesney said in an email. “Occupying oil fields in Syria to keep the Syrian government as well as the Russians out of those oil fields sure looks like something that does not fit with the past examples” of the use of military force under the 2001 authorization.

Meanwhile, Trump has insisted that the broader U.S. withdrawal from Syria is ongoing despite the announcement that troops and armor would remain in Tanf, on the border of Jordan, Iraq and Syria, and in the eastern Syrian province of Deir al-Zour, where the oil fields are.

The administration announced a complete withdrawal earlier this month and have been moving forces out of northeastern Syria over the past two weeks, despite concerns from Pentagon and State Department officials that the withdrawal would allow ISIS to rise again.

“We’re out. But we are leaving soldiers to secure the oil,” Trump said Saturday. “And we may have to fight for the oil. It’s okay. Maybe somebody else wants the oil, in which case they’ll have a hell of a fight.”