LONDON — Boris Johnson looked set to stay on as prime minister and win a huge majority in the British Parliament, according to an exit poll published as voting closed in what has been called the most important election in a generation.

A Conservative victory would mean that the United Kingdom is all but certain to finally leave the European Union on Jan. 31, more than three and a half years after the Brexit referendum in 2016. A divided and deadlocked Parliament had previously blocked Johnson’s withdrawal deal multiple times, prompting this election.

The ruling Conservative Party was predicted to win 357 seats in the House of Commons Thursday, an increase on the 298 it held going into the election, according to a poll released just after 10 p.m. local time (5 p.m. ET). There are 650 seats in the Commons and a party needs to have at least half to command a majority.

If the poll reflects the final results, it will be the biggest majority for a Conservative government since 1987, when Margaret Thatcher won her third and final election.

Thank you to everyone across our great country who voted, who volunteered, who stood as candidates. We live in the greatest democracy in the world. pic.twitter.com/1MuEMXqWHq — Boris Johnson (@BorisJohnson) December 12, 2019

As the size of his potential victory became clear, Boris Johnson, who held held onto his Uxbridge and south Ruislip seat in west London with a majority of more than 7,000, told his supporters: "It does look as though this One Nation Conservative government has been given a powerful new mandate to get Brexit done.''

President Donald Trump also tweeted as the results came through.

Looking like a big win for Boris in the U.K.! — Donald J. Trump (@realDonaldTrump) December 13, 2019

If the poll does prove correct it would also be worst result for the opposition Labour Party since 1935. The party stood on a radical platform to curb the power and influence of big business in favor of workers’ rights and was predicted to win just 201 seats, well below the numbers needed to form a government outright.

Admitting it had been a "very disappointing" night, Labour leader Jeremy Corbyn said he would not lead his party into another general election.

After he was re-elected to his Islington North seat in London, he said he would ensure there was a "process of reflection" within the party.

"I will lead the party during this period to ensure this discussion takes place," he said.

The party had attempted shift the focus of the election onto the U.K.'s public health system and other social issues, but Corbyn said that Brexit had "so polarized debate it has overridden so much of normal political debate."

While some members blamed the party's stance on Brexit for the defeat, others pointed the finger at Corbyn for the heavy defeat.

Alastair Campbell, a former adviser to centrist Labour Prime Minister Tony Blair and longtime critic of the party leader, told the BBC: “When you look at just how bad these results are, this is not just a defeat for Jeremy Corbyn, this is a defeat for the politics that he represents."

He added: “This delusion that they just have to keep on with this Corbynism and eventually the British public will see it for what it is and they’ll flock to support it. It is never going to happen. Fundamental truths have to be faced otherwise Labour Party faces oblivion."

If he wins the commanding majority that the exit poll predicted, Johnson will visit Queen Elizabeth II to be invited to form the next government, a constitutional formality. Johnson is the 14th prime minister since the queen took the throne in 1952. The first was Winston Churchill.

The Liberal Democrats, the centrist pro-European party which promises to cancel Brexit if elected, is predicted to win 13 seats, far below what it may have hoped for as the loudest anti-Brexit voice in this election.

The party went into the election with 21 members of Parliament,but several of those were politicians who had defected from Labour or the Conservatives in protest over Brexit and who had never previously stood for the party.

Liberal Democrat leader Jo Swinson began the campaign with the promise that she could be the next prime minister. But the 39-year-old lost her own seat in East Dunbartonshire to Scottish National Party (SNP) rival Amy Callaghan by less than 150 votes.

The threat to the main parties from the Brexit Party, formed by former U.K. Independence Party leader Nigel Farage as a populist pro-Brexit alternative to the Conservatives, appears to be over. The exit poll predicts it will win no seats.

Early in the campaign the Brexit Party was expected to challenge several seats that voted to leave the European Union in 2016. But Farage then pulled candidates out of all 298 Conservative-held seats, so that he wouldn’t be seen to undermine the U.K.’s chances of leaving the E.U. in January, and the party’s support duly plummeted.

The SNP, which wants Scotland to be an independent nation separate from the U.K., is predicted to win 55 seats, an improvement on the 35 it had going into the election. The SNP has been talked of as a possible coalition partner for Labour if the Conservatives fail to win a majority.

If the poll proves correct it would be the party's second-best result ever, and only one fewer MP than it secured in 2015, when it won all but three seats in the country. The party would continue to be the third-largest party in the U.K. Parliament.

SNP leader Nicola Sturgeon said that while it "suggests a good night" for her party, "what it indicates UK wide though is grim."

The poll suggests both Labour and the Scottish Conservatives could be in for losses north of the border, with the Tories having won 13 seats two years ago, while Jeremy Corbyn's Labour secured seven Scottish MPs last time around.

British broadcasters have been using exit polls since 1974 and while they returned some inaccurate results in the 1970s, 1980s and 1990s, they have been much more reliable in recent years, calling the 2005 and 2010 elections exactly right.