You have to salute the rulers of Iran. They stand on the verge of scoring a stunning diplomatic triumph over the United States. Even more impressive: They did it all on bluff. Their adversaries possessed material advantages in terms of money, technology, military power, and more. But Iran’s rulers had clarity of purpose and the will to win. Without these qualities, the adversaries’ material advantages have seeped away.

A year ago, the rulers of Iran faced disaster. Their currency had lost three-quarters of its value, due in largest measure to the tough economic sanctions drafted by Senators Mark Kirk and Robert Menendez in 2011, and very reluctantly signed into law by President Obama at the beginning of 2012. Inflation was raging, unemployment was surging. Their most useful regional ally, the Syrian regime’s Bashar al-Assad, seemed doomed to destruction, attacked from within by a violent uprising and threatened from without by Obama’s commitment to intervene to stop Assad’s use of chemical weapons.

Today, the United States and Britain are coordinating bombing missions with Assad, not against him. Iran has obtained considerable sanctions relief. Its currency has strengthened, inflation has abated, and foreign trade and investment are reviving. The United States has progressively reduced its demands for nuclear limits on Iran. The New York Times reports that the Obama administration has retreated from the longstanding demand that Iran dismantle its nuclear centrifuges, instead merely calling for Tehran to disconnect them from each other. Iran’s nuclear-enrichment capacity would remain intact, and Iran could resume its progress toward a weapon at almost any time, at the price of only the delay necessary to reconnect the maze of tubing.

This most recent proposal marks the latest in a series of American climb-downs. Iranian negotiators have sniffed at each round of American concessions and insisted on more. As best as outsiders to the talks can tell, they have obtained them. On the present trajectory, any final agreement will leave Iran paused on the verge of nuclear-weapons capability—and this time, with the U.S. having signed away any non-military means of preventing Iran’s final drive to complete a bomb.

What an extraordinary negotiating achievement! They should teach it as a case study in business schools. How on earth did the rulers of Iran do it?

Iran entered negotiations with something to sell and something to buy. The thing to sell was the nuclear program; the thing to buy was a more normal relationship with the United States and the Western world.

The talks began because the United States possessed powerful means of compulsion against Iran: from sanctions, to sabotage, to military force. But the rulers of Iran took the measure of their opposite numbers. They recognized that their counterparts were nearly as averse to using those means of compulsion as were the Iranians themselves. A stick that your adversary dreads using is no stick at all.

The United States also had carrots to offer, above all the relaxation of sanctions and a more normal U.S.-Iran relationship. Yet even before ISIS advanced in northern Iraq, the Obama administration had made up its mind that this carrot was something that the United States needed even more than Iran did. Just as a stick that you dread using is no stick at all, so a carrot that you yourself crave ceases to be much of a carrot.

The unsurprising result: The United States—which began the nuclear talks from a position of strength—has acted throughout the negotiations like the weaker party. The U.S. visibly hungered for a deal, and Iran took advantage of that hunger. One noteworthy milestone on the way to the U.S. collapse was the July decision to grant a six-month extension of the nuclear talks just 20 days after Secretary John Kerry had published an op-ed in The Washington Post warning that no extension would be forthcoming unless Iran showed “genuine willingness to respond to the international community’s legitimate concerns.” Iran instead remained obdurate—and got the extension anyway. From that point onward, the Iranian negotiators had every reason to believe that they had gained the upper hand against their weaker-willed foes.

The rulers of Iran brilliantly upended the whole grammar of the negotiation. Instead of offering their nuclear program to get rapprochement, they began offering rapprochement in exchange for the U.S. accepting a higher level of Iranian nuclear capacity. They convinced the Americans that the thing Iran most desperately needed—a rapprochement with the United States—was in America’s interest even more than theirs. They convinced the Americans that it was America, not Iran, that should therefore make nuclear concessions to achieve this rapprochement. In the annals of flimflam, there stand few more impressive achievements. We are heading toward an outcome in which Iran will not only get everything it wanted, but also will pay nothing for it. And not only will the U.S. have been thoroughly scammed, but the victims of the scam will brief friendly journalists about their diplomatic triumph—and, even more pitifully, will believe it.