Iraq, the financial crisis, the expenses scandal — all of these undermined trust in politicians. They created an impression of a governing class that was devious, inept and venal. But the damage they did to public faith in politics is nothing compared with the damage that will be done by a failure to deliver Brexit.

Brexit is the result not just of a referendum but of two general elections. The Tories would not have won a majority in 2015 without their pledge to hold a referendum on Britain’s EU membership. In 2017, Labour wouldn’t have been able to deny the Tories a majority if they had not been committed to respecting the result of that referendum.

Yet Brexit is now in danger of being cancelled altogether. MPs would vote to revoke Article 50 completely if they believed that the alternative was no deal — so if you don’t want that to happen, a way forward has to be found. This was the case that Michael Gove made in the seven-hour cabinet meeting. Tellingly, there was virtually no pushback to his analysis.

So the government ended up talking to Jeremy Corbyn before a mad scramble to try and get the House of Commons to support something that May can take to the European Council next week to justify asking for another extension.

Brexit has already been delayed once. But as if this humiliation was not enough, the government will now ask for another extension at next week’s emergency meeting of the EU Council. For the second time in three weeks, the UK’s immediate future will be decided in Brussels. It will be the EU which decides what kind of extension to grant and any of the 27 EU member states could block it, effectively forcing this country out without a deal. But despite EU leaders emphasising how they are losing patience with this country, they are unlikely to take such a dramatic step.

May is bracing herself for the offer of a long extension of EU membership, which will require her to hold European Parliament elections. But the EU will say that the UK can end this extension early, and cancel the European Parliament elections, as soon as it has got the withdrawal agreement bill through.

It’s safe to say that, after the last few weeks, not many Tories are looking forward to elections any time soon — there is a reason why Theresa May is so desperate to avoid having them. The EU’s elections have never been taken very seriously in Britain and tend to be used to remind the government of the day of people’s frustrations. But if the electorate is asked to vote three years after Britain voted to leave, then it will be full of righteous anger for both Labour and the Tories. These elections would see the mother of all protest votes, as the electorate gave vent to the rage that is building up out there.

But the preparation for these elections mean that the Tories will soon be in campaign mode, and facing up to the new realities. Ukip ought to do well in these elections but it has become a very different kind of party since the referendum. In the past, it used to try to keep out street thugs such as Tommy Robinson. Now it invites him in to advise the party and seems to bask in his reflected notoriety. Voters might well realise that the Ukip of 2019 is a different and uglier beast than the one that won the Euro elections in 2014.

That’s why Nigel Farage will run against Ukip in these elections. He intends to stand for the newly formed Brexit Party, dedicated to upholding the referendum result. I understand that Farage believes Ukip’s flirtation with Tommy Robinson will enable him to dismiss his old party as the new BNP — and then dismantle it, in the same way he did Nick Griffin’s lot. Seats in the European Parliament will bring some money and a parliamentary base from which to menace the Tories. Given that Tory activists were this week tearing up their membership cards and publishing the pictures on social media, there are a great many voters up for grabs.

But it won’t just be the Brexit side of the debate where new parties emerge. The Independent Group are establishing themselves as a party, Change UK, so they can fight the European elections. Their clear, uncompromising advocacy for staying in the EU means that they’ll take votes from Labour, which has been much more equivocal on this question. The list system means that both the Brexit Party and Change UK will end up with MEPs if these elections take place, giving them office holders to put on the TV, money and infrastructure. These challenges to the main parties would come at a time when, according to a poll last week, just 7 per cent of voters feel a strong connection with the political party they support. By contrast, 40 per cent feel strongly about the side they backed in the EU referendum.

Whatever the Commons agrees on will be a softer Brexit than May’s deal. This will lead to a slew of disaffected Tory MPs, not to mention voters. At the same time, the Tories’ confidence and supply partners the DUP will be seriously unhappy. The government will have agreed and ratified an international treaty with provisions that the DUP believes risks separating off Northern Ireland from the rest of the UK. Theresa May has said that she’ll step down as Tory leader before the second phase of the Brexit negotiations. The events of this week mean that May will have to go as soon as the withdrawal agreement bill is passed (which would happen if, for example, the Commons endorses a customs union). There will then be a crowded and unpredictable leadership race to pick her successor.

The new prime minister will face a dilemma: how to govern? The backstop might mean the DUP is no longer prepared to prop up the Tories, leaving them with no majority. Any new Tory prime minister might have to go for an election, especially if they sought to improve on whatever Brexit compromise May ends up agreeing with parliament. Most Tories are still holding out for a simple Canada-style free trade agreement with the EU which would remove Great Britain from the EU’s regulatory orbit. But as one minister, a likely leadership contender, puts it, ‘You have to have an election to get to Canada.’

To date, the Tories have been terrified of an election: there is talk of internal polling showing Iain Duncan Smith losing Chingford, and of a staggering lack of funding (one cabinet member says the party needs £10 million to fight an election but has barely £1 million in the bank). Other horror stories are shared by party activists. Most Tory MPs regard an early election as a disastrous idea — the old adage is that governments lose elections rather than oppositions winning them. So strong is the feeling among Tory MPs against an early election that one leadership candidate intends to promise not to fight one. (Theresa May, of course, made precisely the same promise.)

This Tory fear of going to the country isn’t entirely self-serving. If Labour was led by a mainstream centre-left figure, many would be prepared to risk what they could see as a short spell in opposition to sort themselves out. But Jeremy Corbyn alters the equation. Many Tories fear that a Corbyn government would change the country for ever. If the Tories haven’t managed to roll back Gordon Brown’s increases in the size of the state after nine years in power, how long would it take them to reverse Corbyn’s

re-nationalisations? But it is not the effect Corbyn would have on the economy that most worries some Tories. Even more than that, they fear what he would mean for Britain’s security. Would the US or other members of the Five Eyes really share intelligence with a Corbyn-governed Britain in the way that they do today?

A new Tory leader would only choose to go for an election if they got a significant bounce and could be confident of securing a proper majority. But at a time when politics is in such a state of flux, who could have such confidence? This election could not be fought on Brexit alone either. If a new prime minister went to the country to try to secure a mandate for leaving the customs union, they would find that topic would take up three days of the election campaign at most. Voters would be keen to talk about a whole host of other issues. Indeed, one of the challenges for May’s successor will be to revive the Tories’ moribund domestic agenda.

The next general election won’t be predictable and it won’t be pretty. The public mood feels rawer and more dangerous now than in 2017. Then, almost a third of voters felt Brexit was being handled well. Just 7 per cent say so now, and even this figure looks suspiciously high. Over three quarters of voters think that parliament has emerged badly from the process. These numbers are going to lead to a reckoning at the ballot box. But it is hard to predict with any certainty who will benefit from the public’s undoubted frustration.

For 40 years, people have spoken of breaking the mould of British politics and ending the two-party system. There have been many false dawns in this story; together Labour and the Tories got 82 per cent of the vote at the last election. But Brexit might just do it. Both main parties are deeply split, ready for civil war and facing deeply unpalatable choices over the next few days. If Jeremy Corbyn cuts a deal with May to get some form of Brexit over the line, he’ll face outrage for throwing a lifeline to the Tory enemy. If he insists on a second referendum, as Labour’s deputy leader Tom Watson wants, he alienates Leave voters in some of Labour’s most vulnerable seats.

For her part, May must decide how many of her Brexit red lines she is prepared to rub out to secure an agreement — it is all a very long way from ‘no deal is better than a bad deal’. For his part, Mr Corbyn will have to work out whether to help the Tories to achieve Brexit (and perhaps split them in doing so) or whether to back those who want a second referendum to stop Brexit. For both, it is a massive test of how far the patience and loyalty of their voters can be pushed. They are hoping that, in the next few weeks, they can break all kinds of commitments and be forgiven on election day. Both parties will emerge from this debacle hugely damaged. The question is which of them will come off worse.

Now listen to Katy Balls talk to James Forsyth and Tim Shipman, Political Editor at The Sunday Times, about the damage Brexit has caused to the main political parties.