Boris Johnson has won a decisive majority in Parliament, which will allow him to push through his renegotiated Brexit deal by the end of January.
But how did it come to pass?
These 12 seats tell the story of the forces at work up and down the country.
One of the abiding images of the night will be Liberal Democrat leader Jo Swinson in tears after losing her seat, which comprised of Milngavie and other middle class suburbs on the north side of Glasgow.
SNP leader Nicola Sturgeon was caught on camera celebrating and punching the air after her party ousted Swinson.
In 2005 Swinson won East Dunbartonshire for the first time, and held it five years later as the Lib Dems went into coalition with the Tories.
She paid the price for that coalition and its austerity programme in 2015, when she was turfed out by the SNP’s John Nicolson, but she made a remarkable comeback two years later and regained the seat.
Swinson was elected Lib Dem leader in the summer but her election campaign has been a complete disaster and the party has not only made no headway nationally, but has lost its leader, defeated by the SNP’s Amy Callaghan by 149 votes.
The Lib Dems will now have to choose a new leader, with Ed Davey the hot favourite.
The Conservatives had a majority of just 31 at the 2017 election in Southampton Itchen, one of the port city’s two constituencies.
Labour’s candidate, Simon Letts, said last month: “We had three recounts. What happened was that 100 Tory votes were wrongly put in our pile. It looked like we had won by 170. For 45 minutes, at about 3am, I thought I was going to be an MP. Then they were moved across and I lost by 31.”
If Labour was going to do anything at this election it had to win seats like Southampton Itchen.
But in fact it failed miserably, with Tory MP Royston Smith increasing his majority to a comfortable 4,498.
Labour made much of the fact that a record 3.2 million people, many of them under the age of 25, registered to vote this year but it made no difference here.
The real story of the night was in seats like Bolsover, a former mining region in Derbyshire.
Dennis Skinner, a former miner himself, had held the seat for Labour since 1970.
Skinner, 87, had been one of a small but vocal minority of Labour MPs who supported Brexit and disagreed with the party’s position on offering a second vote.
Dennis lost his seat, sad day , respect to Dennis Skinner pic.twitter.com/8QvqyPxFK1— Carol Lynn . (@clynn561) December 13, 2019
But despite his own Leave credentials, the man known as “The Beast of Bolsover” was unceremoniously turfed out by the Conservative Mark Fletcher, who turned a 5,288 Labour majority into a 5,299 Tory majority.
The loss of seats like Bolsover, Great Grimsby, Workington and North West Durham, came as a seismic shock to Labour, which has simply been punished by voters who saw the party as obstructing the Brexit they wanted.
Hastings & Rye
Labour had high hopes of gaining Hastings & Rye, the former seat of ex-Home Secretary Amber Rudd.
Rudd announced only in October she would not be seeking re-election and the local Conservatives chose Sally-Ann Hart as their new candidate.
Hart has already mired in controversy, with the Conservative Party investigating her for allegedly sharing anti-Semitic tropes and a viral video from the hustings in which she is booed as she tried to defend paying disabled people less benefits “because they don’t understand money”.
But in the end none of that mattered as she comfortably beat Labour’s Peter Chowney.
The Liberal Democrat Nick Perry - who said recently : “I genuinely believe I can win” - came third, but his vote rose and it appeared some Labour voters switched to the Lib Dems, which led to Hart increasing her majority to 4,043.
West Bromwich East
Labour has had some bad election nights in the past - Tory landslides in 1979 and 1983, the disappointment of defeat in 1992 when Neil Kinnock thought he had it won, and 2010 when Gordon Brown lost power after 13 years - but when Labour lost West Bromwich East they knew 2019 would be every bit as bad.
The seat was held with by Tom Watson, Labour’s Deputy Leader, since 2001 and his predecessor Peter Snape held it right back until the constituency was created in 1974.
Watson was set to be challenged by veteran left-winger George Galloway and former Tory MP Harvey Proctor, who had a personal grudge against Watson, who he blamed for encouraging the delusions of Carl Beech, who was jailed in July for making up stories about a murderous paedophile ring which supposedly included Proctor.
But Watson dramatically quit on 6 November and after a last-minute selection, Ibrahim Dogus was chosen as Labour’s candidate.
Dogus had no connection with West Bromwich - he is a Kurdish restaurant owner in north London, but has good connections with Jeremy Corbyn and others high up in the Labour Party.
With no Watson, Proctor stood down but Galloway is still on the ballot paper although Dogus’s biggest challenge came from the Conservatives’ Nicola Richards, a 24-year-old native of the Black Country.
Watson had a majority of 7,713 majority in 2017 but the constituency voted overwhelmingly (68 per cent to 31 per cent) to Leave in the 2016 referendum and Dogus was heavily defeated.
Richards won by 1,593 with Galloway only getting 489 votes.
At the 2017 election one of the biggest shocks was Labour winning Canterbury, the historic city in Kent which had been Conservative literally forever.
Rosie Duffield beat the long-time Tory MP Julian Brazier by just 187 votes and this time was up against Anna Firth, a barrister and Conservative councillor.
The Greens deliberately did not field a candidate, while the Liberal Democrats have put up Claire Malcomson, despite the original Lib Dem candidate stepping down to keep the Tories out.
The city - which has been a constituency since 1295 - has a flourishing arts and music scene, energised by its increasingly diverse population and its 40,000 students. But it also has a number of dilapidated social housing blocks spread across the city, which Labour targeted this year.
The fact Duffield won it with an increased majority - up to 2,036 from 187 - showed the appeal of Corbyn’s Labour Party to the liberal, pro-Remain intelligentsia.
Labour also won Putney, a former Tory seat in London, and narrowly missed out on holding on to Kensington, a seat it won by only 45 votes in 2017.
But these victories were dwarfed by the Tory tidal wave in former solid working-class Labour constituencies in the North of England, the Midlands and Wales.
Losing West Bromwich East to the Tories could have been put down as a fluke result caused by the loss of a long-standing MP and his replacement by a parachuted “outsider”.
The seat was only 67th on the Tories’ list of targets but it voted to Leave in 2016, while Labour MP Madeleine Moon remained steadfastly pro-Remain.
Imagine living in Bridgend and voting Tory. Get a grip of your life. Everyone who voted Conservative today should be ashamed of themselves for falling for Tory propaganda pedalled by the top 1% of this atrocity of a country.— Dan Carter (@HEELDannCarterr) December 12, 2019
So when Labour lost Bridgend in south Wales, it signalled a Tory landslide.
Moon’s share of the vote collapsed by 10 percent and the Conservative, Jamie Wallis, won with a majority of 1,157.
Cities of London and Westminster
It was a bad night for the Liberal Democrats and they failed to pull off a coup in the so-called Two Cities constituency in the heart of the capital.
The Lib Dems had high hopes they could come from nowhere to win the seat, with their candidate Chuka Umunna, a former Labour MP who quit the party in February and chose not to run for the Lib Dems in Streatham.
The incumbent MP Mark Field decided to stand down after an embarrassing incident last year when he manhandled a female climate change protester.
Labour’s original candidate Steven Saxby, a vicar nicknamed the “Radical Reverend”, quit in October after a historic sexual harassment allegation was made, which he strongly refutes.
His replacement, Gordon Nardell QC, a lawyer who in July this year resigned as Labour’s in-house counsel overseeing the disciplinary process over anti-Semitism allegations within the party, was beaten into third place.
Nickie Aiken, the leader of Conservative-run Westminster City Council, won the seat with a majority of 3,953 over Umunna.
Last month the Green Party candidate Zack Polanski told Sputnik he believed he could win: “If enough people in the City of London and Westminster decide they have had enough and want to tackle the climate emergency, Brexit and inequality then I will be walking into Parliament and representing them as their first Green MP. They will finally have someone on their side for the first time.”
But the Greens also had a bad night nationwide and Polanski got only 728 votes.
Jeremy Corbyn knew it was time to start writing his resignation letter when the Conservatives won Sedgefield in County Durham.
Labour majorities in red wall seats in 1997:— Sebastian Payne (@SebastianEPayne) December 13, 2019
Bishop Auckland: 21,064
Great Grimsby: 16,244
Clwyd South: 13,810
All have gone blue #ge2019
Labour had a majority of more than 6,000 in this seat, which was represented by a certain Tony Blair between 1983 and 2007.
But it voted 59 percent in favour of leaving the European Union in the 2016 referendum and many people in the North East of England felt their democratic choice had been ignored about by Jeremy Corbyn and his Cabinet, most of whom represent seats in Remain-supporting London.
Labour’s Phil Wilson lost the seat by a stonking 4,153 votes to the Conservative, Paul Howell.
Uxbridge & South Ruislip
It would of course have been a historic night if Labour’s candidate Ali Milani gained Uxbridge, a seat which has been held by Boris Johnson since 2015.
If that had come to pass it would be the first time in British political history that an incumbent prime minister had been turfed out.
The Conservative Party constitution says the leader of the party "shall be drawn from those elected to Parliament" but Johnson could technically stay on as prime minister for a few weeks - until a new leader is elected by the party - in the unlikely event that the Tories had won the election but lost Uxbridge.
But Labour should not have got their hopes up.
Johnson won easily, increasing his majority from 5,034 to 7,210.
Finchley and Golders Green
The Labour Party, and Jeremy Corbyn in particular, were hamstrung throughout the election by constant criticism for failing to lance the boil of anti-semitism.
Although the number of complaints were tiny compared to a membership of 500,000 the damage was done and Corbyn was unable to shake it off.
The Jewish community abandoned Labour completely and it showed in seats like Finchley and Golders Green, where the Tory MP Mike Freer held on comfortably.
Labour was pushed into third place with Luciana Berger, a Jewish former Labour MP who quit the party over the issue, coming second for the Liberal Democrats.
In Bury South, another seat with a large Jewish community, the former Labour MP Ivan Lewis quit the party but his successor, Lucy Burke saw her vote share cut by 10 percent and the Tories took advantage, with Christian Wakeford elected with a majority of 402. Lewis, standing as an independent, got 1,366 votes.
The Democratic Unionist Party (DUP) - who were crucial to keeping Theresa May in power for two years from June 2017 - were punished by voters for their naivete in being manipulated by the Tories and Boris Johnson.
The DUP lost two seats - Emma Little-Pengelly lost Belfast South to the SDLP’s Claire Hanna and Nigel Dodds lost Belfast North to Sinn Fein’s John Finucane, whose father Patrick was murdered by loyalist paramilitaries during The Troubles.
The DUP also failed to win North Down - where the independent unionist Lady Sylvia Hermon was stepping down - which was won by the non-sectarian Alliance Party.
The setback could mean DUP leader Arlene Foster could face a leadership challenge and perhaps a new DUP leader would finally agree to sit down with Sinn Fein and restore power-sharing in Northern Ireland.