Boris Johnson, the ebullient Brexiteer who has promised to lead the United Kingdom out of the European Union with or without a deal by Halloween, will replace Theresa May as prime minister after winning the Conservative Party leadership on Tuesday.

May will leave office on Wednesday after going to Buckingham Palace to see Queen Elizabeth, who will formally appoint Johnson before he enters Downing Street.

His victory catapults the United Kingdom toward a Brexit showdown with the EU and a constitutional crisis at home, as lawmakers have vowed to bring down any government that tries to leave the bloc without a divorce deal.

Johnson, the face of the 2016 Brexit referendum, won the votes of 92,153 Conservative members to 46,656 for his rival, Foreign Secretary Jeremy Hunt.

"We are going to get Brexit done on Oct. 31, and we are going to take advantage of all the opportunities it will bring in a new spirit of 'can do,'" Johnson, 55, said in his victory speech.

"Like some slumbering giant, we are going to rise and ping off the guy-ropes of self-doubt and negativity."

Johnson said the mantra of his leadership campaign had been to "deliver Brexit, unite the country and defeat [opposition Labour leader] Jeremy Corbyn — and that is what we are going to do."

Canadian Prime Minister Justin Trudeau congratulated Johnson and said he looks forward to working with him to increase trade between Canada and the U.K.

Congratulations, <a href="https://twitter.com/BorisJohnson?ref_src=twsrc%5Etfw">@BorisJohnson</a> - I look forward to working with you to keep the close friendship between Canada & the UK strong and to increase trade and create more jobs for people in both our countries. —@JustinTrudeau

U.S. President Donald Trump also tweeted his congratulations to Johnson.

Congratulations to Boris Johnson on becoming the new Prime Minister of the United Kingdom. He will be great! —@realDonaldTrump

But Johnson — known for his ambition, mop of blonde hair, flowery oratory and cursory command of policy detail — takes office at one of the most tumultuous junctures in post-Second World War U.K. history.

Divided Kingdom

The 2016 Brexit referendum showed a United Kingdom divided about much more than the European Union, and has fuelled soul-searching about everything from regional secession and immigration to capitalism, the legacy of empire, and modern Britishness.

Brexit, which has already toppled two Conservative prime ministers, will dominate.

Watch Boris Johnson address Conservative Party members in victory speech:

The British Conservative Party announced today that Boris Johnson has won its leadership contest, making him PM as of tomorrow 0:38

Johnson has pledged to negotiate a new Brexit divorce deal with the EU to secure before Oct. 31. But if the bloc refuses, as it insists it will, he has promised to leave anyway — "do or die" — on Halloween.

It is a step many investors and economists say would send shock waves through world markets and tip the world's fifth largest economy into recession or even chaos.

A Brexit without a divorce deal would also weaken London's position as a pre-eminent international financial centre while jolting the northern European economy.

French President Emmanuel Macron congratulated Johnson, and said he hopes they can start discussing Brexit and other international matters, including tensions with Iran, "as soon as possible." Macron's views were echoed by Ursula von der Leyen, the future head of the European Commission.

Johnson's Conservatives have no majority in Parliament and need the support of 10 lawmakers from Northern Ireland's Brexit-backing Democratic Unionist Party (DUP) to govern. After Johnson's win, the DUP said its agreement with the Conservative Party would remain and a normal review of the arrangement will take place over the coming weeks.

Even then, the majority is wafer thin, and some lawmakers have threatened to bring down the government, a step that would probably deepen the U.K.'s political crisis and lead to an election.

Jeremy Corbyn, leader of the U.K.'s opposition Labour Party, used Johnson's win to highlight his call for a fresh general election.

"Boris Johnson has won the support of fewer than 100,000 unrepresentative Conservative Party members by promising tax cuts for the richest ... But he hasn't won the support of our country," Corbyn said on Twitter.

Johnson’s No Deal Brexit would mean job cuts, higher prices in the shops, and risk our NHS being sold off to US corporations in a sweetheart deal with Donald Trump.<br><br>The people of our country should decide who becomes the Prime Minister in a General Election. —@jeremycorbyn

Johnson, for his part, told Conservative Party members that he does not want to hold an early general election, said senior lawmaker Nicky Morgan, who met with the incoming prime minister on Tuesday.

From private school to PM

The rise of Alexander Boris de Pfeffel Johnson, known simply Boris, to the top of U.K. politics is the grandest twist so far in a career that has taken him from journalism via TV-show fame, comedy and scandal into the political brinkmanship of the Brexit crisis.

Born in New York, Johnson was educated at Eton, Britain's most exclusive school, and at Balliol College, Oxford. He began his career at a management consultancy in London but dropped out after a week.

He then turned to journalism, but was sacked from the Times newspaper for making up quotes.

Johnson, in 2010 when he was London mayor, with South Africa World Cup Soccer mascot Zakumi at Trafalgar Square in London. (Sang Tan/Associated Press)

Hired by the Daily Telegraph, Johnson infuriated European officials and delighted then Prime Minister Margaret Thatcher by lampooning the European Economic Community with a host of sometimes misleading reports from Brussels.

After entering politics, he was sacked from the Conservative Party's policy team while in opposition for lying about an extramarital affair.

But his sometimes shambolic personal appearance and disarmingly self-deprecating confidence have allowed him to survive both gaffes and scandal. He served two terms as London mayor, from 2008 to 2016.

In 2016, he became one of the most recognizable faces of the Brexit campaign, which won the referendum by 52 per cent to 48 per cent.

"I know that there will be people around the place who will question the wisdom of your decision, and there may be some people here who still wonder what they have done," Johnson told party members during his victory speech. "I will just point out to you that no one party, no party has a monopoly of wisdom." Johnson said.

"Do you look daunted? Do you feel daunted? I don't think you look remotely daunted to me."