EVER since Donald Trump’s election, he has had in his sights the “worst deal ever”—the one reached in 2015 that sought to circumscribe Iran’s nuclear ambitions. For a while the threat to the survival of the agreement looked more rhetorical than real. No longer. On January 12th the president signed the waiver that prevents the reimposition of nuclear-related sanctions on Iran for a further 120 days. But, against the advice of his national-security team at the time, he warned that this would be the last such waiver unless the European parties to the deal—Britain, France and Germany—worked with America to fix what he regards as the fatal flaws in the agreement.

The prospects for the deal became even bleaker on March 13th, when Mr Trump announced the sacking of Rex Tillerson. His replacement as secretary of state is Mike Pompeo, a fierce critic of the agreement, known more formally as the Joint Comprehensive Plan of Action (JCPOA). The replacement of H.R. McMaster as national security adviser nine days later by John Bolton almost certainly sounded its death knell. Mr Bolton was an abrasive American ambassador to the UN under George W. Bush. Despite a stint as under-secretary for arms control and international security in the same administration, Mr Bolton appears never to have seen an arms-control agreement he liked.

Unlike other self-declared haters of the Iran deal, Mr Bolton does at least have an answer to the question “what next?” if it is jettisoned. A few months before the deal was signed in July 2015, Mr Bolton boomed: “The inconvenient truth is that only military action…can accomplish what is required.” Air strikes on Iran’s nuclear facilities, he argued, could set the programme back by “three to five years”.

In an article this year Mr Bolton struck a less bellicose note, claiming that the reactivation of nuclear-related sanctions, plus some new ones, could bring the “seemingly impregnable authoritarian” Iranian regime to its knees. America’s declared policy, he argued, should be to end Iran’s Islamic revolution before its 40th birthday in 2019. But it is unlikely that sanctions, combined with unspecified “material” support for Iranian opposition groups, could bring about regime change, and unclear whether Mr Bolton really believes that they could.

About North Korea, he is equally blunt. In August Mr Bolton called talking to the hereditary Marxist dictatorship “worse than a mere waste of time”. If China would not agree to work with America to dismantle Kim Jong Un’s regime (an implausible scenario), the only alternative was “to strike those [nuclear] capabilities pre-emptively”. In this view, if the proposed summit between Mr Trump and Mr Kim takes place, it may be no more than the prelude to an ultimatum and perhaps even to war.

After his appointment, Mr Bolton said that opinions previously stated “in private” (an odd way to describe newspaper articles) were now “behind” him. Playing down his image as a warmonger, sources claim that in his new role he sees himself as an honest broker between agencies. They cite Brent Scowcroft, a respected national security adviser under the senior George Bush, as a model. That seems far-fetched. Mr Bolton is both an ideologue and a ferociously effective bureaucratic infighter, with a history of reshaping intelligence reports to suit his own purposes.

Mr Bolton’s appointment alarms the “E3” (Britain, France and Germany), which signed the Iran deal along with Russia, China and Iran itself. It casts an even darker cloud over their efforts to find a way of appeasing Mr Trump’s demands before hitting the 120-day buffer on May 12th.

Spirit measures

The JCPOA is a highly technical 159-page document. But Mr Trump’s two main objections are straightforward. The first is that, even if Iran is sticking to the letter of the deal, its actions often violate its spirit. So it does not matter that over the past two years inspectors from the International Atomic Energy Agency (IAEA) have filed 11 reports judging that Iran is keeping its promises to curb its nuclear programme.

The Iran deal was designed as a pragmatic arms-control agreement that cuts off Iran’s route to a nuclear weapon for a period of time. But its opponents have always wanted it to do far more. Some wish it would also check Iran’s prolific meddling across the Middle East. Iran backs Shia militias in Syria and Iraq, stokes the war in Yemen and supports Hizbullah—a Lebanese Shia militia that threatens Israel with thousands of missiles and occasionally fires them. For the accord’s critics, Iran is a “bad actor” to be isolated, not engaged.

They also want a deal that curbs Iran’s ballistic-missile programme, which has continued apace since 2015. Under UN resolution 2231 that enshrines the nuclear deal, Iran is “called upon” to refrain from work for up to eight years on ballistic missiles for nuclear weapons. But it does not impose sanctions if Iran carries on regardless. Congress has imposed new missile-related sanctions on Iran in the past year. The E3 have not, though they are reported to have sounded out EU support for them.

Mr Trump’s second gripe is that even on its own terms, as an arms-control pact, the Iran deal falls short. It allows for unprecedented levels of inspection, but critics say that it still allows the Iranians to keep anything they classify as a military site off-limits to inspectors. This is not strictly true—an admittedly slow and cumbersome procedure allows access to such sites if evidence emerges of their being used nefariously.

What most concerns the deal’s detractors are the “sunset” provisions. These allow key constraints on Iran’s nuclear programme to lapse over time. For example, after eight years (ie, in 2023), limits on the use of faster-spinning uranium-enrichment centrifuges are relaxed; in 2028 Iran can ramp up the number of centrifuges it employs; after 2030 constraints on Iran’s stockpile of enriched uranium disappear. However, the IAEA’s uniquely intrusive monitoring continues until 2040.

The Europeans do not disagree with these criticisms of the Iran deal. Nor are they more relaxed than the Trump administration about Iran’s regional troublemaking. Where they differ is in their belief that blowing up the deal would make everything its critics complain about even worse. That includes perhaps putting Iran back on a path to developing nuclear weapons and thus starting not just the war that Mr Bolton has long thirsted for, but also a helter-skelter of proliferation in a volatile region close to Europe.

Working with a joint team from the State Department and the National Security Council, the E3 have been desperately trying to find a way for Mr Trump to claim enough of a win on May 12th to sign the sanctions waiver again. European diplomats had thought that they were making some progress on two crucial issues—ballistic missiles and inspections.

Aniseh Bassiri Tabrizi of RUSI, a London-based think-tank, believes that, like the Americans, the E3 could impose sanctions related to Iranian ballistic-missile tests without violating the Iran deal. Sir Simon Gass, a former British ambassador to Tehran who led the British team negotiating the deal, says that it might be possible to get an agreement from Iran not to develop an intercontinental-range ballistic missile (ICBM) capable of hitting America. An ICBM, he points out, only makes sense if it carries a nuclear warhead, so testing one should prompt broad economic sanctions. Patricia Lewis of Chatham House, another London think-tank, believes that the Europeans may already be talking to the Iranians about a future regional missile-deal that would ban long- and intermediate-range nuclear missiles.

On inspections, Sir Simon believes that the existing regime is more than adequate. But the E3 could reach clearer understandings with the Americans: about the instructions given to national intelligence agencies monitoring Iran’s nuclear programme; and about how they would jointly deal with Iranian obfuscation if a breach were suspected.

As for “sunsetting”, the E3 have made it clear that the issue cannot be dealt with quickly. Sir Simon reckons that there is, however, broad agreement it must be tackled. The trick will be to get the Iranians to start thinking about what comes after the expiry of the constraints imposed by the nuclear deal. It must be made clear to them that continuing to reap the benefits of it will depend on maintaining a nuclear programme with entirely peaceful purposes. Installing thousands of new centrifuges and building a huge uranium stockpile will not pass muster.

Mr Trump could claim on May 12th that his toughness had pushed the Europeans into tackling the flaws in the Iran deal and that he would hold his fire. That has been the E3’s hope. But with Mr Trump’s instincts fortified by Mr Pompeo and Mr Bolton, it looks remote. After May 12th, the E3’s priorities will be to convince Iran to keep complying with the deal; to limit the harm to the transatlantic relationship that will follow if America abandons it; and to try to buy some time for the European firms and banks trading with Iran that will be exposed to American secondary sanctions.

Some are optimistic that Iran will stick to the deal. But Iranian hardliners have always opposed it and will argue, with some justice, that their warnings of American perfidy have been borne out. Ellie Geranmayeh of the European Council of Foreign Relations says that Iran will see advantages in “winning the blame game” and will want to “delegitimise US sanctions” in the eyes of China, Russia and most of Asia by sticking to its obligations. The Iranians may also calculate that if they swiftly crank up their nuclear programme, they would give the White House and Israel cause to threaten military action and Saudi Arabia the excuse to start enriching uranium. (Ironically, both the Saudis and the Israeli security establishment, despite their public opposition to the Iran deal, would these days probably prefer it to survive.)

Stuck in the middle with EU

Mark Fitzpatrick of the International Institute for Strategic Studies hopes that Mr Trump, having quit the deal, might cut the Europeans some slack and not enforce secondary sanctions. Ms Geranmayeh agrees that is possible but thinks it more likely that America’s Treasury would allow only a grace period for existing deals, such as those struck by Total and Shell, two energy giants, and some “carve-outs” for other firms. She does not think the European Union would achieve much by reinstating “blocking regulations” to penalise European firms that comply with American sanctions. The firms may well fear being shut out of American markets more than fines imposed by Brussels. One option, says Sir Simon, is that EU member governments could extend non-dollar lines of credit and credit guarantees to European companies that would face stiff penalties for sticking to plans to do business in Iran.

Europe will find itself in a horribly uncomfortable place. It will be further distanced from its most important ally on a matter of principle. It will at the same time find itself sharing a bed with traditional adversaries (Russia, China and also Iran). And it will face a new threat to its own security—Syria has shown that when bad things happen in the Middle East, Europe is vulnerable as a target for terrorism and as a destination for displaced people.

But America will suffer, too, if Mr Trump refuses to sign the waiver. Its reputation as a country that keeps its word will have been further trashed. It will find that the international coalition on sanctions patiently put together by the Obama administration to bring Iran to the negotiating table cannot be rebuilt. It will have done yet more damage to relations with its allies. And it will have increased the chances of both a big new war and a nuclear-arms race in the Middle East.