The fate of a remote U.S. military base in southern Syria captures the contradictions at the heart of President Trump’s Iran policy.

The tiny outpost at Tanf, surrounded by vast desert, was established during the battle against the Islamic State. But its purpose changed last year when Iranian-backed forces began bearing down on the isolated garrison.

U.S. officials feared that a small, exposed force of special operators there could be overrun as Iran, fighting in support of the Syrian government, sought to lock down a land route to Damascus and the Mediterranean Sea. U.S. strikes on the encroaching forces risked pulling the Pentagon further into Syria’s civil war.

But for some senior aides, the tense encounters around Tanf were an opportunity: a chance to bolster an operation that had become an accidental bulwark against Iran, and launch a larger campaign against Tehran’s military reach in the region.

The fraught White House deliberations, which began last May and still continue today, illustrate the confusion that has characterized Trump’s response to Iran’s political and military influence across the Middle East, now at a high-water mark from Syria to Yemen and beyond.

From the moment his administration put Tehran “on notice” in a dramatic warning days into his presidency, Trump has promised in the most bellicose terms since President George W. Bush’s “axis of evil” to act decisively against Iran.

“No matter where you go in the Middle East, wherever there’s a problem, Iran is right there,” Trump said during a news conference last month, blaming Tehran as he had many times before for fueling “violence, bloodshed and chaos” across the region.

So far, Trump’s strategy has centered on his opposition to the 2015 agreement to halt Iran’s nuclear ambitions, which he has described as “the worst deal ever.” The president’s decision on Tuesday to withdraw from the pact will force the White House and the Pentagon to shift focus to blunting Iran’s influence on battlefields across the Middle East.

For a president and his increasingly hawkish foreign policy team, the coming months could be pivotal. Trump will have to reconcile his tough rhetoric on Iran with his oft-stated desire to pull back from the Middle East and withdraw from Syria.

Nowhere is the gap between word and action clearer than at Tanf.

For U.S. allies in the region and the Iran hawks, the desert outpost has become a barometer of America’s willingness to stand up to Iranian influence. The U.S. presence at Tanf also raises a tough question for Trump: How much blood and treasure is he willing to risk to counter Iran’s military reach?

‘Like Mars out there’

The focus on Iran at Tanf began as something of an accident.

In 2016, the U.S. military was making progress against Islamic State extremists in Iraq and Syria, when President Obama approved a small training program for Syrian forces just across the border in Jordan. The Pentagon proposed inserting the U.S.-backed fighters at Tanf, which had been recaptured from militants that year.

One selling point of the desert outpost was its isolation. Surrounded by miles of sand, it was relatively easy to defend.

“It’s like Mars out there,” a senior U.S. official said. “Just desert and a road.”

Initially, the plan was to move the forces at Tanf and their American advisers north along the border with Iraq, where they would link up with other U.S.-backed units fighting the Islamic State and help recapture a strategic border crossing at Bukamal.

But before they could move out, Iranian-backed troops aligned with Syrian President Bashar al-Assad’s government advanced toward the Iraqi border, obstructing the planned U.S. move northeast.

Rather than fight their way through enemy lines, the U.S.-backed troops and their American advisers stayed put. A small team of U.S. soldiers, who initially cycled through the outpost on 24-hour missions, began hunkering down for longer stretches lasting days and even weeks.

The hazy mission at the Tanf base quietly shifted from battling the Islamic State, which gradually lost its tiny foothold in the area, to countering the growing Iranian presence.

Not only were the U.S. troops at Tanf helpful in protecting a nearby refu­gee camp, but many officials said they also could be used to interrupt shipments of weapons, personnel or funding from Iran to the Assad government in what military officials had long characterized as Tehran’s “land bridge” across the Middle East.

Completing the supply line would augment Iran’s air route, helping Tehran build up its military infrastructure in Syria and posing a sharp threat to U.S. ally Israel.

Soon, Iranian-backed forces began challenging the American position in a bid, U.S. officials believed, to reclaim a nearby border crossing and link up with sister forces in Iraq.

Last May, U.S. warplanes fired on a column of troops loyal to Assad, including Iranian-backed militiamen, who were headed toward the outpost. A few weeks later, U.S. aircraft struck the forces again after they fortified their position near Tanf. Then in June, the U.S. military shot down two Iranian drones around Tanf.

“It was a scary few weeks,” a senior State Department official said of the attacks, who, like others, spoke on the condition of anonymity to talk about internal discussions.

The Pentagon boosted air surveillance over the base and gave the troops there antitank weapons to better defend against an armored Iranian assault.

In a sign of nervousness on both sides, U.S. officials received a secret letter, delivered through the Swiss government, from Maj. Gen. Qasem Soleimani, commander of the Quds Force of Iran’s Revolutionary Guard Corps, multiple current and former officials said. Soleimani was a frequent presence with militia units on the front lines, a hardened fighter U.S. officials saw as the embodiment of Iranian ambitions.

The State Department eventually responded, telling the Iranians that the U.S. military would destroy any Iranian-backed forces that got within 30 miles of the base.

Inside the White House, officials who wanted to do more to counter Iranian influence began pushing to expand the security bubble around the Tanf base. The most ambitious plans called for creating a safe zone where the U.S. military could train a force to challenge Iran and the Assad regime in southern Syria.

“It certainly looked like it was a pivotal moment on who was going to come out victorious on the policy — the ones that really wanted to take the fight to the Iranians in Syria and those that didn’t,” the State Department official said.

But the bolder military plans ran into resistance from the Pentagon and, more significantly, Trump’s conflicting desires.

Trump had loaded his administration with Iran hawks, including short-lived national security adviser Michael Flynn and then-CIA director Mike Pompeo. He also forged close ties with Saudi Arabia and other Persian Gulf states that were sounding the alarm about Iran.

Trump has taken small steps to blunt Iran’s aggression, imposing new financial penalties on Iranian affiliates and slapping a new terrorism designation on the Revolutionary Guard Corps. In a move symbolizing an effort to replace Iran’s influence with support from U.S. allies, diplomats have orchestrated a renewal of Saudi ties with Shiite-led Iraq.

The administration has also intensified its attempts to publicly shame Iran, showcasing missile fragments and other weaponry that officials say proves that the country is helping rebels attack U.S. allies in the Gulf.

Again and again, Trump has boasted about his toughness on Iran. In a recent Fox News interview, he insisted that the Iranians had toned down their “death to America” rhetoric since he moved into the White House and suggested that his threats of force had moderated Iran’s maneuvers in the Persian Gulf. “We haven’t seen their little boats circling our ships in the ocean lately,” he said.

But Trump just as often has appeared unwilling to risk an open conflict with Iran, gravitating to his opposition to the nuclear deal during discussions about the larger Iran strategy, current and former officials said.

In recent weeks — and sometimes even in the same news conference — he has talked about staying at Tanf to block Iran and expressed support for leaving Syria entirely.

“We will have a strong blockage to the Mediterranean, which to me is very important — because if we don’t, you have Iran going right to the Mediterranean. Not going to have that,” he said in a briefing in which he had also declared: “We’re going to be coming home relatively soon.”

Those clashing messages have left U.S. allies in the Middle East “chagrined,” said a former senior U.S. diplomat in the region. “They’re worried that we’ll leave . . . and about the message that sends to Iran.”

Trump has been adamant in private conversations with his top national security aides: the U.S. priority is defeating the Islamic State and getting out of Syria, not battling Iran.

“Whenever they bring up Syria, he says ‘I want Syria to be Putin’s problem.’ Whenever they bring up Iraq, he says ‘What’s the least I can do,’” a former U.S. official said. “The actions don’t mesh with what could be a larger strategy against Iran.”

‘Get off the sidelines’

Trump’s top military leaders are also reluctant to expand the mission in Syria and check Iran, worried about the safety of troops scattered across the region.

From the 1983 bombings of the Marine barrack in Beirut to guerrilla attacks on U.S. troops in Iraq after 2003, groups backed by Iran are blamed for hundreds of U.S. military deaths.

Defense Secretary Jim Mattis, whose combative approach to Iran led to his early departure from the military in 2013, has described Iran as a chief threat in the Middle East. But he also has acted to keep the impulses of the administration’s Iran hawks in check and has argued for reorienting the military to deal with more pressing threats from a rising China and increasingly aggressive Russia. Mattis’s main focus of late has been preparing for possible conflict with North Korea.

Gen. Joseph F. Dunford Jr., chairman of the Joint Chiefs of Staff, and Gen. Joseph L. Votel, head of U.S. Central Command, have advocated building up partner forces that might make it harder for Iranian-backed militias to operate.

It’s too soon to say whether Trump’s new national security adviser, John Bolton, an outspoken advocate of regime change, will seek to challenge those instincts.

In the wake of Trump’s decision on the nuclear deal, the White House this past week condemned new attacks on Israel and Saudi Arabia by Iranian-linked groups. In Yemen, U.S. officials have been seeking new ways to disrupt shipments of missile parts to Houthi rebels battling a Saudi-led military coalition there.

“It is time for responsible nations to bring pressure on Iran to change this dangerous behavior,” press secretary Sarah Huckabee Sanders said.

Any action the United States might seek to take is almost certain to have negative costs, potentially increasing risks to U.S. personnel.

In Syria, the big question is what, if anything, stays behind at Tanf if Trump follows through with his promise to get U.S. troops out of Syria.

Former envoy Dennis Ross, who has advised presidents of both parties on the Middle East, said the United States may be pulled into a regional conflict if no action is taken to constrain Iran in Syria, and conflict erupts between Iran and Israel, which could appeal for U.S. help. On Thursday, Israel launched the latest in a series of escalating attacks against Iranian targets in Syria

“That is a war that you know how it starts but you don’t know how it ends,” he said. “Rather than waiting, why not get off the sidelines?”