For months, the Trump administration has been coping with a huge problem to which it has no solution.

Iran has been the big winner of the conflicts in Iraq and Syria. Its intervention in the Syrian civil war and influence over its Shia allies in Iraq has enabled it to acquire a land bridge to Lebanon, which is dominated by its Hezbollah auxiliaries.

The implications for this strategic coup for US interests and any hope for Middle East peace are enormous but the administration doesn’t seem to have a clue about what to do about it.

Yet at least a partial answer to this dilemma is at hand in the form of a referendum to be held this month on independence for Iraqi Kurdistan. Kurdish independence could create a state that would act as a firewall against Iran’s quest for regional hegemony.

So why has the US been going all out to stop the Kurds from voting? On Friday, a White House statement flatly demanded the referendum be called off.

It boils down to a fear that Kurdish independence would be a distraction from the war on ISIS. The Kurdish Peshmerga troops have been the most effective land force in the Western-led push to destroy the Islamic State.

That fight is finally succeeding. But since Turkey, Iran and especially the government of Iraq bitterly oppose Kurdish independence, the US has treated the referendum as a threat to a successful conclusion to the campaign against the terrorists.

That’s why Secretary of Defense James Mattis has asked the Kurds to delay their vote for independence. Other US officials are also working to pressure them to once again put off their hopes.

If ISIS was the only threat to US interests in the region, that would make sense. But as Trump knows, Iran’s growing strength is just as dangerous, if not more so.

Against the advice of some on his national-security team, President Trump is still determined to roll back the nuclear deal President Barack Obama made with Iran. He understands the agreement did nothing to prevent an Iranian bomb in the long term and has enriched and empowered Tehran by ending its economic isolation. Iran has maintained its nuclear infrastructure while spreading terror and testing missiles that will eventually provide a platform for the nukes it can build after the deal expires.

Complicating matters is that Trump’s desire for better relations with Moscow has led him to follow Obama’s lead and acquiesce to giving Russia’s Iranian partners a free hand in Syria. That has created a basic contradiction in his foreign policy that he has failed to resolve.

A policy switch that encourages the Kurds could throw a monkey wrench into Iran’s plans to use its clients in Iraq, Syria, Lebanon and the Hamas state in Gaza to create a sphere of influence that endangers America’s Arab allies and threatens Israel with a three-front war at any time of Iran’s choosing.

What would a US green light to the Kurds entail?

Even in the worst-case scenario in which the Kurds’ foes sought to crush them, there would be no need for a commitment of US forces or even for Washington to guarantee Kurdish independence. The Kurds have proved they can defend themselves. All America needs to do is to place no obstacles in their path and follow through on administration promises to continue aid to the Kurds.

Turkey, Iran and the Shia-dominated government of Iraq have a common interest in repressing Kurdish hopes for independence. That’s why seeking to put off the Kurds with vague promises about the future won’t work.

Instead of pledging to keep an Iranian-dominated Iraq united, Trump needs to seize this chance to put Tehran on the defensive on one front, while also pushing hard to roll back the nuclear deal and curbing their terror and missile outrages.

The Kurds have been loyal allies in our struggles against terror. Backing their independence is the right thing to do. But it is also the smart play in America’s ongoing struggle to keep the Iranians from making the Middle East their playground. Rather than listen to those urging him to betray them, Trump should embrace the chance the Kurds are offering him to hamstring Tehran at little cost to the United States.

Jonathan S. Tobin is opinion editor of JNS.org and a contributing writer for National Review.