N O PLAN BY any modern British government has been so soundly thrashed as the Brexit deal thrown out by Parliament on January 15th. The withdrawal agreement, the centrepiece of Theresa May’s premiership, which she has spent nearly two years hammering out with the European Union, was rejected after five days’ debate by 432 votes to 202. Her own Conservative backbenchers voted against her by three to one.

The mother of parliaments is suffering the mother of all constitutional crises (see article). Three years ago, in the biggest poll in the country’s history, Britons voted in a referendum to leave the EU . Yet Parliament, freshly elected a year later by those same voters, has judged the terms of exit unacceptable. The EU shows little willingness to renegotiate. The prime minister ploughs obdurately on. And if this puzzle cannot be solved by March 29th, Britain will fall out with no deal at all.

To avoid that catastrophe, the priority must be to ask the EU for more time. But even with the clock on their side, MP s seem unlikely to agree on a solution to Brexit’s great riddle: what exit terms, if any, truly satisfy the will of the people? With every week in which MP s fail to answer this question, it becomes clearer that the people themselves must decide, in a second referendum.

The rout this week was the result of two years of political misjudgment. The referendum of 2016 was won by just 52% to 48%. Yet rather than consult the defeated side, Mrs May pursued a hardline Brexit, hurriedly drawn up with a handful of advisers and calibrated to please her Conservative Party. After she lost her majority in 2017 the need to build a consensus became clearer still, but she doubled down. Even after Parliament established its right to vote on the final deal, she didn’t budge, instead trying (and failing) to frustrate Parliament’s vote by running down the clock. The doggedness that has won her many admirers now looks like pig-headedness. The prime minister’s promise after this week’s crushing defeat to work with opposition MP s comes two years too late.

But the crisis is not just about poor leadership. Brexit has exposed two deeper problems. One concerns the difficulties that will face any country that tries to “take back control”, as the Leave campaign put it, in a globalised, interconnected world. If you take back the right to set your own rules and standards, it will by definition become harder to do business with countries that use different ones. If you want to trade, you will probably end up following the rules of a more powerful partner—which for Britain means the EU or America—only without a say in setting them. Brexit thus amounts to taking back control in a literal sense, but losing control in a meaningful one. Leavers are right that the EU is an increasingly unappealing place, with its Italian populists, French gilets jaunes, stuttering German economy (see article) and doddery, claret-swilling uber-bureaucrats in Brussels. But they could not be more wrong in their judgment that the EU ’s ominous direction of travel makes it wise for Britain to abandon its seat there.

The second essential problem Brexit has exposed concerns democracy. Britain has a long history of representative democracy, in which MP s are elected by voters to take decisions on their behalf. The referendum of 2016 was a rarer dash of direct democracy, when the public decided on a matter of policy. Today’s crisis has been caused by the two butting up against each other. The referendum gave a clear and legitimate command to leave the EU . To ignore it would be to subvert the will of the people. Yet the people’s representatives in Parliament have made an equally clear and legitimate judgment that Mrs May’s Brexit deal is not in their constituents’ interests. To sideline MP s, as Mrs May has all along tried to do, would be no less a perversion of democracy.

The prime minister has piled moral pressure on MP s to back the deal anyway, arguing that even if they don’t much like it, it is what their constituents voted for. It is not so simple. Mrs May’s deal is not as bad as some of her critics make out, but it is far from what was promised in 2016. Ejection from the single market, the decline of industries ranging from finance to carmaking, the destabilisation of Northern Ireland and an exit bill of some $50bn: none of this was advertised in the campaign. Voters may be entirely happy with this outcome (opinion polls suggest otherwise). But there is nothing to say that the vote to leave must entail support for Mrs May’s particular version of leaving. That is why all sides can claim to represent the “real” will of the people. For MP s to back a deal that they judge harmful out of respect for an earlier referendum which issued a vague instruction would be neither representative democracy nor direct democracy—it would be one doing a bad impression of the other.

The first step to getting out of this mess is to stop the clock. Because Mrs May’s deal is dead and a new one cannot be arranged in the ten remaining weeks, the priority should be to avoid falling out on March 29th with no deal, which would be bad for all of Europe and potentially disastrous for Britain. If Mrs May will not ask for an extension, Parliament should vote to give itself the power to do so. This desperate measure would up-end a long convention in which government business takes precedence over backbenchers’. But if the prime minister stays on the road to no deal, MP s have a duty to seize the wheel.

With more time, perhaps a deal might be found that both Parliament and the EU can agree on. Either a permanent customs union or a Norwegian-style model (which this newspaper endorsed a year ago as the least-bad version of Brexit) might squeak through. But both would demand compromises, such as Britain relinquishing the right to sign its own trade deals or maintaining free movement, that contradict some Leave campaign promises.