WASHINGTON — In the days after President Donald Trump paved the way for Turkey to invade Syria, several of his closest allies went to the White House — twice — to try to change his mind, according to four people familiar with the meetings.

Retired Gen. Jack Keane, a Fox News analyst, first walked the president through a map showing Syria, Turkey and Iraq on Oct. 8, pointing out the locations of oil fields in northern Syria that have been under the control of the United States and its Kurdish allies, two people familiar with the discussion said. That oil, they said Keane explained, would fall into Iran's hands if Trump withdrew all U.S. troops from the country.

Keane went through the same exercise with Trump again Oct. 14, this time with Sen. Lindsey Graham, R-S.C., at his side, according to four people familiar with the meeting. Keane displayed a map showing that almost three quarters of Syria's oil fields are in the parts of the country where U.S. troops are deployed, the people familiar with the meeting said. They said that Graham and Keane told the president that Iran is preparing to move toward the oil fields and could seize the air space above them once the U.S. leaves.

Download the NBC News app for breaking news and politics

The president seemed "resigned" to leaving a small number of American troops in northern Syria to keep control of the oil, according to a person who was present.

Before showing Trump the map, Keane and Graham joined the president to listen in on his phone calls with Turkish President Recep Tayyip Erdogan and Gen. Mazloum Kobani Abdi, the leader of the Kurdish forces aligned with the U.S., people familiar with the call said. Graham helped arrange the call with the Kurdish general.

The episodes shed light on how the latest twist in Trump's orders of a Syria withdrawal — that the U.S. needs troops there to "secure the oil" — emerged. Trump's comments in recent days about the need for U.S. troops to secure oil fields in Syria have raised questions about where the idea came from and fueled widespread confusion about what the president's mission is for American forces deployed there.

Trump is raising the oil issue amid unrelenting pressure from fellow Republicans, and some members of his own administration, to reverse his decision to order a complete U.S. withdrawal from Syria.

Since Trump's phone call with Erdogan on Oct. 6 that precipitated his announcement of plans to withdraw all U.S. troops from Syria, his allies inside and outside the administration have been floating various proposals to try to contain the fallout both politically at home and logistically on the ground in Syria, current and former U.S. officials said. On Monday, the president delivered contradictory public statements about a plan that would keep some U.S. troops in northern Syria indefinitely to conduct counterterrorism missions and protect the oil fields.

"I don't want to leave any troops there," Trump told reporters. "I don't think it's necessary other than we secure the oil."

The president's comments came as the Pentagon was preparing orders for maintaining several hundred troops in northern Syria, according to a senior U.S. official.

Keane declined to comment, as did a spokesman for Graham.

The White House didn't respond to a request for comment.

On Oct. 7, the day before Keane, whom Trump had considered to be his defense secretary, first came to the White House to talk to him about Syria, he appeared on Fox News and described the president's decision on Syria as a "strategic blunder." His in-person presentation to Trump on Oct. 8 seemed to leave an impression on the president, according to two people familiar with it. One of them said Trump "responded favorably."

But it didn't seem to be enough to convince the president to reverse course. Keane returned to the White House on Oct. 14, when Graham also was there. They were both in the Oval Office among the roughly dozen people listening to Trump's phone calls with the Kurdish general and Erdogan.

Show him the maps

This month wasn't the first time Trump has been shown a map detailing economic assets to convince him not to follow through on ordering U.S. troops home, officials said.

Members of Trump's national security team and his allies outside the administration have regularly gone through that exercise with him since he took office, officials said.

In the first two years of the administration, current and former officials said Trump so frequently threatened to withdraw U.S. troops from Afghanistan, Syria, Iraq and even the Korean Peninsula that some of his advisers developed a system for talking him down from taking such steps. The effort included showing him visual materials like maps to walk through the reasons why an abrupt withdrawal would be detrimental to U.S. interests, officials said.

For Syria, the exercises focused on the oil and how it would fall into Iran's hands if the U.S. withdrew, officials said. Keane was among those who walked Trump through a Syria map showing oil fields after the president announced in December 2018 that he would withdraw all U.S. troops there. That announcement also followed a phone call between Trump and Erdogan.

On Afghanistan, the presentation to Trump included a map of the country's rare earth minerals, largely used in electronic devices, officials said.

The goal was to frame the argument in economic terms that Trump was more likely to respond than a purely military strategy, they said. With Syria, the prospect of economic leverage also dovetailed with Trump's inclination to block anything advantageous to Iran, officials said.

The focus on Iran in trying to convince Trump to keep a contingent of U.S. troops in northern Syria — rather than on potential action by Russia, which officials say is far more capable and likely to make moves to harness the oil — is in part because the president has appeared more likely to be persuaded by proposals aimed at countering Iran than Russia, according to one former U.S. official.

One defense official said while the emphasis on oil in Syria is intended to convince the president that the U.S. military presence is valuable, securing the oil fields is not a military strategy. U.S. troops will not actually be guarding the oil fields, the official said.

"Keeping troops at one or two locations near the oil fields would be extremely expensive and hard to re-supply them," the official said.

'Imminent invasion'

U.S. military officials acknowledged Monday that they don't know if troops in Syria are actually going to stay or for how long.

Defense Secretary Mark Esper said he and the chairman of the Joint Chiefs of Staff recommended the initial pullback of U.S. troops in northern Syria because of "the imminent invasion by the Turks," a NATO ally.

Now, he said, the focus is on presenting options to Trump that address how to maintain the counter-ISIS operation after a U.S. withdrawal from northeast Syria, shore up defenses in Iraq and deny oil revenues to the Islamic State militant group and other adversaries.

On Monday, Esper told reporters that a small contingent of U.S. troops currently working with Kurdish allies to secure the oil fields will only remain in the country until the full withdrawal of U.S. forces is complete in a matter of weeks.

The administration began withdrawing the 1,000 troops in northern Syria in recent days.

Esper said the U.S. troops that will remain for some weeks in towns near the oil fields are there to "deny access to those oil fields by ISIS and others who may benefit from those revenues that could be earned."

Trump has agreed to keep a small contingent of American forces in southern Syria as a deterrent to Iran.

Jim Jeffrey, the State Department's special representative on Syria, has advocated for keeping a couple hundred troops in northern Syria, according to two officials.

Administration officials, including Secretary of State Mike Pompeo, continue to lobby U.S. allies to take ISIS prisoners imprisoned in Syria who are citizens of their countries.

"This is all Trump damage control," one former official said.