The European Parliament elections have exposed Britain as more divided than ever about leaving the European Union, putting pressure on both main parties to adopt harder positions. But they present both the Conservatives and Labour with almost impossible dilemmas.

The success of the Nigel Farage’s Brexit Party, which built on Ukip’s 2014 victory to win a third of the vote, will encourage Conservative leadership candidates to promise to leave the EU on October 31st, with or without a deal. Frontrunner Boris Johnson and his strongest rival on the right of the party, Dominic Raab, have already made that commitment.

They argue that voters abandoned the Conservatives for the Brexit Party because Theresa May failed to take Britain out of the EU on March 29th and that her refusal to countenance a no-deal Brexit weakened her negotiating hand. And they believe that the credible threat of a no-deal Brexit will persuade the EU to put a time limit on the Northern Ireland backstop.

The EU’s decision last month to offer Britain a six-month extension has encouraged a view at Westminster that other EU countries fear a no-deal Brexit more than most of them actually do. And the election results elsewhere in Europe promise to change the balance of power in the European Parliament to the disadvantage of Britain’s negotiators.

Brexiteers were hoping that a surge in support for nationalists and the far right in Europe would encourage the EU to be more flexible in dealing with a new British prime minister. But although the far right made gains, the big winners were the Greens and the Liberals, both of whom are deeply committed to the European project and are strong supporters of the Irish position on the backstop.

BREXIT: The Facts Read them here

Liberal leader Guy Verhofstadt’s contempt for Britain’s negotiators was on display in a recent BBC a fly-on-the-wall documentary but Philippe Lamberts, the Greens’ top spokesman on Brexit, is just as uncompromising.

“We would rather bite the bullet of a no-deal Brexit rather than bite the bullet of destroying the single market because that second bullet is a lasting one and a bigger one than no-deal Brexit,” he said during a visit to Dublin last February.

No confidence vote

Chancellor of the exchequer Philip Hammond suggested on Sunday that he could support a vote of no confidence in a Conservative government that sought to push a no-deal Brexit through parliament. Other moderate Conservatives have also refused to rule out triggering a general election rather than approving a no-deal Brexit.

Few Conservatives believe they have a chance of winning an election as long as Brexit remains unfulfilled so MPs choosing the two leadership candidatesto put before the party membership must balance the discomfort of compromise on Brexit with the risk of triggering an election that could put Jeremy Corbyn in Downing Street.

Corbyn faces a dilemma too as heavy losses to the Liberal Democrats and Greens put him under pressure to commit Labour to a second referendum on Brexit. Corbyn and his inner circle of advisers have held firm to an ambiguous approach to Brexit that has served Labour well for almost three years but is now at breaking point.

Embracing a clear, pro-Remain position would help to stem the party’s losses in the south of England, especially in London. But Labour also lost votes to the Brexit Party in other parts of the country, so a policy that could cancel Brexit will come at a cost in those places.

The least costly option may be the one Corbyn started groping towards on Monday morning, to seek a better Brexit deal but to promise to put any deal – even one negotiated by Labour – to a confirmatory referendum.