UNLIKE earlier Eurospats, David Cameron’s campaign for European Union reform had seemed to be going more or less to plan—until this month. The Tory party won an unexpected majority in May, so the prime minister had to honour his commitment to wring a few concessions for Britain from the EU and hold an in/out referendum by the end of 2017. But he was diplomatic enough to meet all 27 other heads of government and even leaders of the European Parliament before putting his demands on the table. And when he set them out in a letter to the president of the European Council, Donald Tusk, they were calculated to be achievable.

The prime minister’s watchword was flexibility, in four areas. He wanted the EU to become more competitive and pursue more trade deals. He sought a bigger role for national parliaments and a recognition that Britain was not bound by the goal of “ever closer union”. He demanded guarantees that euro-zone members would not discriminate against non-members. And he called for an end to “benefits tourism” by stopping EU migrants claiming in-work tax credits and housing benefits until they had been in Britain for four years.

Most of these reforms were doable, even if some governments sucked their teeth for form’s sake. Mr Cameron did his bit by not insisting on a new treaty: he merely wanted his changes to be “legally binding and irreversible”. As one French official puts it, clarifications of the treaties are fine, but changes are not.

The exception to the harmony was the benefits change, which other governments declared illegal under EU laws on non-discrimination and free movement of labour. Even here Mr Cameron offered flexibility: if another solution could be found, he would consider it. Proposals to redesign the British benefits system on contributory lines were a non-starter. But there was talk of a four-year residency requirement that would catch young Britons as well as EU migrants. And a new debate has begun about allowing Britain to impose an emergency brake on migrant workers.

The stage was thus set for a deal at an EU summit on December 17th-18th and a referendum in the first half of 2016. But then Mr Cameron dropped a bombshell. Far from being flexible, he demanded an early protocol (a treaty needing to be ratified by all national parliaments) to permit the bar on in-work benefits for four years. He hinted that if this were rejected he might lead the Brexit campaign himself. Mr Tusk’s response was swift. He called Mr Cameron’s demand “most delicate” and declared that it had no support (one of his advisers says flatly that it is 27 against one). And he said there was now no chance of a deal in December, though he hoped a compromise might be found in February.

Why has Mr Cameron raised the stakes like this? One answer is the appeal of brinkmanship. He knows no EU country wants Brexit, so his bargaining position seems strong. His party fondly recalls Margaret Thatcher’s tough negotiations to win a European budget rebate. Four years ago Mr Cameron basked in Westminster ovations after “vetoing” an EU fiscal treaty, even though it went ahead without him. The British love of one against all in Brussels dies hard (see Charlemagne).

Mr Cameron’s team also thinks the benefits demand is justified. Welfare is a national not a European competence. Several countries have discriminatory laws: Denmark limits foreign property-buying, Germany wants to impose motorway tolls on non-Germans, the Dutch are said to discriminate financially against other EU students. Britain is seeing a big inflow of EU migrants (see chart).

Few migrants come just to collect benefits. Stephen Nickell of the Office of Budget Responsibility, Britain’s fiscal watchdog, suggested this week that the four-year bar would not reduce migration by much. Yet the fact that low-paid jobs taken by migrants attract generous tax credits and housing benefits from the start seems unfair to many voters. Some ministers say that without some change, the referendum will be lost. And after embarrassingly losing a House of Lords vote on tax-credit cuts in October, Mr Cameron is loth to solve his problem by curbing benefits for all. He is also impatient with lawyers who bleat about breaches of the treaties. Some officials in London thought the benefits proposal could pass without treaty change, but they were overruled. Mr Cameron hopes that in February political leaders will be willing to go over the heads of mere lawyers. Yet there are three big reasons to worry about his tactics. One is that, unlike the Thatcher budget rows, there is no easy way to split the difference. If the benefits change is unlawful, it may be overturned by an individual appeal to the European Court of Justice unless the treaty is changed. A two-year limit is no better than a four-year one. And it is surely politically impossible for parliaments in Poland, Slovakia, Romania or Bulgaria to ratify a treaty authorising discrimination against their own citizens. Second, prolonged argument over welfare benefits could further delay the referendum. Most pollsters reckon a later vote is likely to boost the leave campaign. Avoidance of delay was a big reason why the government this week pressed the House of Commons swiftly to overturn a House of Lords plan to extend the referendum franchise to 16- and 17-year-olds.