So it was the Brexit election after all. It started out as one when Theresa May overhyped the threat of pro-Europeans in Parliament weakening her negotiating hand to justify her decision to seek her own mandate.

Then it became the non-Brexit election. May offered no new detail about her plans, and the spotlight fell on public services and then security. But Brexit undoubtedly affected the outcome of this remarkable election. Remainers, and young people who perhaps didn’t bother to vote in last year’s referendum, took their revenge.

The hard Brexiteers hoped the election would put the final nail in the coffin of those they call the Remoaners. Instead the tables have been turned.

General Election 2017: 6AM results - hung parliament confirmed

The Remainers have an unexpected spring in their step today. May has paid a very heavy price for ignoring the 48 per cent. The hard Brexiteers, who always feared the prize would somehow be snatched from them even after the referendum, are re-living their worst nightmare.

Brexit will still go ahead, since the Conservatives and Labour, who won more than 80 per cent of the votes between them, both promised that. But it could now be a very different Brexit, a much softer version than the one May wanted. Membership of the single market and customs union, ruled out by May, are now back on the agenda. She wanted to marginalise Parliament in the Brexit process; if she had won a majority, the House of Lords would not have blocked leaving the single market or customs union as this was in the Tory manifesto.

General Election 2017: Big beasts who lost their seats Show all 7 1 /7 General Election 2017: Big beasts who lost their seats General Election 2017: Big beasts who lost their seats Nick Clegg Picture By Darren O'Brien/Guzelian Picture Shows Former MP, Nick Clegg delivers a speech despite losing the Sheffield Hallam Seat. Labour candidate, Jared O'Mara (Front), defeats Nick Clegg to take the Sheffield Hallam seat. picture taken 08/06/2017 Darren O'Brien General Election 2017: Big beasts who lost their seats Gavin Barwell LONDON, ENGLAND - OCTOBER 07: Gavin Barwell MP arrives at Number 10 Downing Street on October 7, 2013 in London, England. British Prime Minister David Cameron announced a Government reshuffle today. (Photo by Oli Scarff/Getty Images) Getty General Election 2017: Big beasts who lost their seats Angus Robertson General Election 2017: Big beasts who lost their seats Nicola Blackwood PA General Election 2017: Big beasts who lost their seats Alex Salmond PA General Election 2017: Big beasts who lost their seats Rob Wilson Mandatory Credit: Photo by Geoffrey Swaine/REX (1096138i) Rob Wilson, Conservative MP for Reading Funeral of Murdered Student Asha Muneer at Rivermead Leisure Centre, Reading, Britain - 28 Jan 2010 Rex Features General Election 2017: Big beasts who lost their seats Ben Gummer Minister for the Cabinet Office Ben Gummer arriving at 10 Downing Street, London for the weekly cabinet meeting. PA

Instead, Parliament will now play a more important role. Pro-European Tory MPs may well link up with like-minded MPs in other parties to push for a soft Brexit. Some MPs and peers will argue that May’s plan for hard Brexit has been rejected.

The Tory hard Brexiteers may try to push May or her Tory successor around. On paper, they might have the numbers. But there may be no majority in Parliament for hard Brexit. The Tories will almost certainly rely on the votes of Northern Ireland’s 10 Democratic Unionist Party (DUP) MPs, who support Brexit but may have their own demands on the issue. They are hard-nosed negotiators.

May will be urged to seek cross-party agreement, which would push her towards a soft Brexit. Squaring the circle between single market access and controlling immigration will not be easy.

An election designed to strengthen May's hand in the Brexit talks has done the opposite. The 27 EU countries will spot weakness. The irony is that EU officials would have preferred a decisive majority for either the Tories or Labour so there was some stability on the UK side of the table. The 27 want to see the back of Brexit and move on to other issues.

Whatever the final shape of Brexit, an already difficult process will now become even more problematic. It could become chaotic, as the Tories' warning about a Labour-led "coalition of chaos" boomerang. Negotiations with the 27 EU countries are due to start on 19 June. A delay may be needed.

We might have a second election before too long, if that became the only way to resolve the impasse between the two big parties in a nation divided between Leave and Remain; the old and young; left and right. An election would cause a further pause in the Brexit talks, even though the clock is ticking towards the March 2019 deadline. It may have to be extended, which would require the agreement of all 27 EU members. But if the talks were going badly, the EU could use the deadline to put pressure on the UK to make concessions – by using the threat of “no deal” being reached in time, and Britain resorting to World Trade Organisation tariffs.

The other scenario is that the Conservatives cannot command a majority in the Commons. It would then fall to Jeremy Corbyn to see if he could win MPs’ backing for a Labour Queen’s Speech.

Labour would try to form a “progressive alliance” with the SNP, the Liberal Democrats, the Greens and Plaid Cymru. They could probably agree on soft Brexit.

But Labour’s policy needs fleshing out. It wants to retain the benefits of the single market but accepts that free movement must end. Corbyn might have to revisit his formula on migration. If he became prime minister, Corbyn would adopt a more constructive and conciliatory approach to the talks. Under him there would be less chance of the UK leaving the EU without a deal than under the Tories.

Corbyn’s position on Brexit in the election has been vindicated. It threatened to tear his party apart. By backing the triggering of Article 50, Corbyn reassured enough Leave voters in the North and Midlands that Labour had accepted the referendum result. May did not scoop up all the Ukip vote as she hoped; Labour got a fair slice after all.