Teresa May last night became the second Conservative Prime Minister in less than year to take an unnecessary gamble, and lose.

She was elevated to the premiership in the aftermath of David Cameron’s reckless decision to hold a referendum on EU membership. After the Brexit vote, and after a terrifying few days in which it seemed possible that Boris Johnson could lead Her Majesty’s Government, May seemed like a godsend.

May’s mantra during the election was an offer of “strong, stable leadership”. Unfortunately her campaign was weak and erratic. May seemed rattled by close contact with the media, and had nothing positive to offer. Her main message seemed to be: I’m not like that crazy old socialist over there. Her goal in calling the election was to strengthen her position, both in Westminster and in her negotiation with Brussels, by winning more seats. Instead she lost a dozen, cutting her parliamentary party to 318.

The Tory losses included seats like Canterbury, which has returned Conservative MPs since the end of World War I and, after three recounts by exhausted election workers, the upscale Kensington. This leaves the Conservatives short of the 326 needed for a parliamentary majority.

As in 2010, we have a “hung parliament”, with no single party able to pass legislation. But unlike 2010, there is no obvious coalition government with what analysts call a “working majority” (code for “not reliant on the mavericks and oddballs”) on the horizon. May therefore has had to secure the support of the 10 Democratic Ulster Unionist MPs in order to form a government. They were, in fact, the only winners of the night. (This is one of those elections where the refusal of the seven Sinn Fein MPS to take their seats in Westminster starts to matter for the math).

Far from stability and strength, the UK faces months if not years of uncertainty and weakness. A second general election, as in 1974, seems quite likely, in order to get a clearer result; especially if the Conservative party orchestrates the defenestration of Mrs May as leader.

All this, remember, just days before negotiations open with the EU on the terms of the UK’s departure. At the best of times, with a strong leader underpinned by a solid parliamentary majority, this would be a demanding test. Now it looks almost impossible.

To be fair to May, nobody saw this coming, at least not until the very final days of the campaign. Jeremy Corbyn, the Labour leader, played it brilliantly. He was judicious, authentic (or at least seemed so), and had a strong message: Conservative austerity was hurting the nation’s future, in part by hurting the young. He offered an agenda that most mainstream analysts considered electorally crazy: higher taxes, more spending on welfare, free college. Capturing 40% of the vote was a serious political achievement on Mr Corbyn’s part.

Like Sanders in the U.S., the Labour leader reached parts of the electorate that others could not; especially disenchanted young voters. Not many people would have predicted that old, white, male, grey-haired socialists would have become such attractive political figures.

For many of Corbyn’s supporters, this was the anti-Brexit election. Older voters voted overwhelmingly to leave the EU, while many pro-European youngsters stayed home. This time, they turned out. Seats with high numbers of young voters, including many college towns, swung strongly towards Labour. According to the BBC’s psephologist John Curtice, the average swing to Labour in seats in places that voted to remain in the EU is seven points. To which pro-Europeans will say, through gritted teeth: yeah, but where were you in last year’s referendum?

It is worth reminding ourselves however that although Labour did much, much better than expected, they didn’t, you know, win. They just lost much more narrowly. Corbyn will now stay on as leader, dashing the hopes of moderate MPs who had been planning his downfall in the wake of a heavy defeat. Time will tell whether Labour’s support will last, or was just a surge. There is a good chance that this is Corbyn’s high-water mark; in which case, Labour faces a long road back to government.

So: the Conservatives lost, and Labour lost. But two-party politics won. Between them the two major parties won 82% of the vote, higher than in any election since the days of Margaret Thatcher. The smaller parties had a poor night.

UKIP were wiped off the map. Without Brexit as a great motivating force, the party has no real raison d’etre.

The Scottish National Party, having run the table north of the border in 2015 in the wake of the lost independence referendum, lost 18 seats and now has 32. Both their former leader, Alex Salmond, and their Deputy Leader Angus Robertson were both defeated; a double humiliation.

The Liberal Democrats managed to get their count of seats back into double digits; but only just, and saw their national vote share tick down slightly Nick Clegg, the former Deputy Prime Minister (and my old boss), lost his seat. Parliament has then lost its most eloquent pro-European.

Referendums are unnatural acts in a parliamentary system, and the shock waves can be felt for many years afterwards. The reverberations of Brexit could be felt all over the electoral map last night, often in unpredictable ways. The electorate is also more volatile; there were some big swings and results that startled seasoned observers.

British politics is starting to look like a game of pinball, as different groups of voters react to the outcome of a previous election. After a failed referendum on Scottish independence, the Scottish National Party soared. Now, after the Brexit vote, younger voters have flocked to Labour. We are now seeing protest votes against previous protest votes.

There were a few silver linings: a record number of women MPs (207 out of 650); almost certainly a reversal of the long-run fall in voting among the young; and the highest turnout since 1997 (69%).

But as a result of this unnecessary election, the UK has a much weaker government, with a diminished Prime Minister, and a more deeply divided parliament, at a time when political strength is most required. All the political parties, in one way or another, managed to lose last night. But the real losers will be the British people themselves. A pointless EU referendum, followed by a needless general election, followed by chaos. Tragedy piled upon tragedy.

Richard V. Reeves is a senior Fellow at Brookings, and author of the new book Dream Hoarders. Twitter: @richardvreeves.