LONDON — British Prime Minister Boris Johnson went to Buckingham Palace to meet Queen Elizabeth II so she could formally invite him to form a new government Friday following his Conservative Party's resounding election victory.

Johnson, the 14th prime minister since the queen took the throne in 1952, promised to "get Brexit done," which clearly resonated with voters and set him on course to take the country out of the European Union.

The Conservatives ended up with 365 seats — a majority of 80 in the House of Commons — versus 203 for the opposition Labour Party.

The result was disastrous for the socialist Labour, which saw its vote share drop 8 percent overall and the loss of key seats across the country in its worst general election performance in three decades. Labour leader Jeremy Corbyn announced he would stand down before the next election, without setting a date, after a period of "reflection."

The Conservative's win means the United Kingdom is all but certain to leave the E.U. on Jan. 31. A divided Parliament has refused to back Johnson's withdrawal bill several times — but he now has enough lawmakers to push it through the House three and a half years after the Brexit referendum.

#BREAKING The United Kingdom will have majority Conservative Government. 🇬🇧 pic.twitter.com/3InBFfanlS — Conservatives (@Conservatives) December 13, 2019

Speaking to party activists in London, Johnson said the election result meant that "getting Brexit done is now the irrefutable, irresistible, unarguable decision of the British people."

He addressed the millions of voters who are not traditional Conservative supporters but who chose the party this time, promising that Parliament had to change.

Download the NBC News app for breaking news and politics

"I say to you that in this election, your voice has been heard and about time too. We politicians have squandered the last three and a half years. We've even been arguing about arguing and the tone of our arguments.

Congratulations to Boris Johnson on his great WIN! Britain and the United States will now be free to strike a massive new Trade Deal after BREXIT. This deal has the potential to be far bigger and more lucrative than any deal that could be made with the E.U. Celebrate Boris! — Donald J. Trump (@realDonaldTrump) December 13, 2019

"I will put an end to all that nonsense. We will get Brexit done by the 31st of January, no ifs, no buts, no maybes."

President Donald Trump was among the world leaders to congratulate Johnson on his win, adding his support for a post-Brexit transatlantic trade deal.

The election, the third in four years, had been described as the most important in a generation as it represented the last realistic opportunity to block Brexit.

It's an historic win for Johnson, the biggest Parliamentary majority since Margaret Thatcher won a decisive victory for the Conservatives in 1987.

In a sign of the seismic shift likely underway, former industrial heartlands which have been staunchly Labour for decades swung to the Conservatives in Thursday's election. Dennis Skinner, the 87-year-old veteran socialist who has held the seat of Bolsover in Derbyshire since 1970, lost by 5,000 votes. Sedgefield in the northeast of England, the former seat for three-time election winner Prime Minister Tony Blair, also voted Conservative.

It wasn't much better for the centrist Liberal Democrat Party — which promised to cancel Brexit if elected. Its leader Jo Swinson lost her seat in East Dunbartonshire in Scotland and the party failed to make many gains elsewhere.

The election raises questions, however, about the future of the United Kingdom. The Scottish National Party, which campaigns for Scotland to be an independent nation, won 48 seats, an increase of 13.

Scotland narrowly voted to remain part of the United Kingdom in a 2014 referendum but the SNP's success makes a second referendum more likely, although it is up to the prime minister to decide whether to hold one.