LONDON — Boris Johnson, the flamboyant pro-Brexit politician, will become the next prime minister of the United Kingdom.

Johnson was chosen as the leader of the ruling Conservative Party on Tuesday, and will become prime minister on Wednesday. After Prime Minister Theresa May formally resigns, Johnson will go to Buckingham Palace on Wednesday afternoon to meet the queen, who will invite him to form the next government.

Johnson is the former mayor of London and resigned as foreign minister a year ago over May's Brexit plans. He was the clear favorite to replace her, with polls putting him ahead by double digits.

He beat his rival, Foreign Secretary Jeremy Hunt, in an election that only Conservative lawmakers and party members were eligible to participate in. Johnson received 92,153 votes to Hunt's 46,656. Under the U.K.’s parliamentary system, a new prime minister can be appointed without the need for a general election.

"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 said after the result was announced in a conference center across from Parliament.

In his typical, hyperbolic fashion he pronounced that, "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."

Hunt soon tweeted his congratulations to his rival, saying that he'll be "a great PM for our country at this critical moment!"

May offered her congratulations to her successor, saying in a tweet that he had her "full support" in trying to bring Brexit over the finish line.

"We now need to work together to deliver a Brexit that works for the whole UK and to keep Jeremy Corbyn out of government. You will have my full support from the back benches," she wrote.

President Donald Trump was one of the first world leaders to tweet out his congratulations to Johnson and later in the day he praised Johnson while speaking at the Turning Point USA Teen Student Action Summit.

"We have a really good man who's going to be the Prime Minister of the UK now, Boris Johnson," Trump said.

He went on to call him "tough" and "smart" and said that Johnson is being called "Britain Trump."

May's decision to resign at the end of May came after months of chaos in Parliament due to Brexit, the U.K.'s decision to leave the European Union.

Johnson was one of the leading faces of the 2016 campaign for the U.K. to leave E.U., a measure which won a narrow victory in a referendum. May had voted to remain, though she embraced the result of the referendum and spent the majority of her time in office pursuing a withdrawal agreement with E.U.

However, hard-line supporters of leaving were always suspicious of May and three times voted down the deal she secured with the E.U.

Brexit is now by far the biggest item on Johnson's agenda. He has staked his reputation on making it happen on or before the next deadline of Oct. 31. E.U. leaders have said repeatedly that they won't reopen the agreement they made with May's government.

The E.U.'s lead Brexit negotiator, Michel Barnier, said on Tuesday that he looked forward to working with Johnson to ratify the withdrawal agreement.

We look forward to working constructively w/ PM @BorisJohnson when he takes office, to facilitate the ratification of the Withdrawal Agreement and achieve an orderly #Brexit. We are ready also to rework the agreed Declaration on a new partnership in line with #EUCO guidelines. — Michel Barnier (@MichelBarnier) July 23, 2019

At one leadership campaign event, he promised to leave the E.U. at the end of October “do or die,” and has said he would consider leaving without a withdrawal agreement.

This so-called “no-deal” scenario would leave the U.K. with no trade agreement, no customs arrangements and lacking shared standards in multiple areas — although it would allow the country to sign bilateral trade deals unconnected to the E.U.

Economists, business leaders and the British government’s own experts have given stark warnings of the damage "no-deal" could do to jobs, investment and trade.

Johnson's first decisions will be who to select for his cabinet.

Many lawmakers in Johnson's own party are deeply skeptical about his leadership credentials and several government ministers under May resigned from their positions just prior to Johnson's selection and after, due to his approach to Brexit.

He's also attracted a hefty dose of negative headlines even before assuming office.

An audio recording of him in a screaming argument with his girlfriend was leaked to the media in June, prompting some awkward questions on the campaign trail.

And he was heavily criticized from across the political spectrum for failing to confirm that he would retain Kim Darroch, the U.K.’s ambassador to the U.S., and the author of leaked diplomatic cables that were highly critical of Trump. Darroch resigned earlier this month.

Johnson also must govern with the threat of a general election hanging over his head, even though the next election isn't scheduled until 2022. His party holds only a slim majority in Parliament and any loss of support from his own side could mean that he suddenly needs to defend his agenda to the wider public.