Obama has consistently disregarded the advice of his military experts on the ISIS threat. And he seems to have written off the Kurdish-Syrian town of Kobani, which may soon be overrun by ISIS.

Whatever the U.S. accomplished after about a decade of war in Iraq has, in a matter of months, deteriorated to a situation that may become unprecedented in its instability and threat to Western interests. Obama’s clumsy departure from Iraq, his military mismanagement of the mess that ensued, and his refusal to intervene in Syria – again, overruling his top security advisers – are what produced the current quagmire.

The loss of Christianity in Mosul didn’t have to happen. Obama’s tardy airstrikes managed to prevent the Mosul Dam from falling, but the city may never be the same. Similarly, why did the Yazidis have to find themselves besieged on Mount Sinjar before the U.S. took action?

Instead of preemptively stopping ISIS from spreading into Iraq, Obama effectively waited until some high-profile beheadings forced him to focus on the danger. While such gruesome murders can reliably rally public opinion in favor of military action, the duty of the Commander-in-Chief is to lead and take military action when and how national security requires it, and not just when terrorists provoke some tardy and token airstrikes into empty buildings.

As the next disaster is about to unfold on Obama’s watch, he should recognize that there is much more at stake with the fight for Kobani than just the loss to ISIS of a small town on the Syria-Turkey border.

Above all, letting Kobani fall means betraying our only ally fighting ISIS on the ground, and allowing them to be massacred while the world watches. What message does the U.S. send to Mideast partners and the world at large, if the Kurds are the only force providing the ground troops that Obama so desperately needs now, and yet Obama is unwilling to support them enough to avoid the horrific slaughter that will follow an ISIS victory in Kobani?

Kobani also has geostrategic importance to the Iranian nuclear threat. The more ISIS succeeds at capturing territory and recruiting fighters, a trend bolstered by Kobani’s fall, the more desperate the U.S. becomes for help from Iran, which, as leader of the Shiite world, is the natural enemy of the Sunni ISIS fighters. Because Iran also has one of the most powerful militaries in the region, and has – even before the ISIS crises – outmaneuvered the West in talks to curb Iranian nuclear ambitions, Iran could easily leverage the situation to secure tacit Western acceptance of its nukes. Indeed, Iran has already signaled its fight-ISIS-for-nukes strategy.

Even more important, as Iran watches how feebly the U.S. responds to the loss of Iraq and how Obama cowers from a relatively minor fight in Kobani, the Ayatollahs can rest assured that there really is no U.S. military option to stop their nuclear program. This conclusion becomes all the more inevitable, when they look at Obama’s waning influence at home, as he enters the lame-duck period of his presidency.

There is also a moral dimension to Kobani. Obama – in his 2009 and 2012 speeches on Holocaust Remembrance Day – proudly recalled how his great uncle helped to liberate a Nazi death camp. Yet Obama’s inaction in Syria has left about 200,000 dead, including many who were simply massacred, and Kobani may be where the next atrocities happen. Does the U.S. not hold itself to a higher standard than that of Turkey, which has thus far chosen just to watch the fighting a mere mile from its border? Turkish history already includes genocides against the Armenian Christians and the Kurds (in the Dersim Massacre), so it’s no surprise that the Islamist regime of Recep Tayyip Erdoğan would let his army stand idly by, watching and waiting for ISIS to slaughter thousands of Kobani Kurds. But does the U.S. really want to be in the same camp as the Turks on this one? How much more shame will fall upon the United States, and the Obama legacy, when the Internet overflows with images of mass graves containing Kobani’s brave and abandoned fighters, along with Kurdish civilians who were too weak, infirm, or elderly to flee the approaching ISIS barbarism?

As if the above concerns weren’t enough to goad Obama into action, there is also the strategic impact of letting Kobani fall. As good as ISIS recruiting on social media already is, the popularity of this terrorist army among Islamists worldwide will surge when ISIS can boast about one more example of how even the mighty US military can’t stop them.

Having foolishly telegraphed that he won’t send ground troops to confront ISIS, Obama can still try to convert his error into a feint, by doing the opposite and sending troops to Kobani. At least that would restore some element of unpredictability to how ISIS regards U.S. military moves in the region.

Obama is effectively weeks away from the lame-duck portion of his presidency. If Republicans take Congress in next month’s midterm elections, then Obama will become that much more ineffectual. But the president can still try to demonstrate some leadership by changing his strategic approach to Mideast threats — if only to prevent his legacy from going into freefall. If the Middle East has only one lesson for Obama, it is that much can go terribly wrong in very little time. With Iranian nukes around the corner and ISIS on the march, two years of Mideast deterioration is a frighteningly long time to be on Obama’s watch.

Noah Beck is the author of The Last Israelis, an apocalyptic novel about Iranian nukes and other geopolitical issues in the Middle East.