Boris Johnson is set to become the United Kingdom's new prime minister after he won the Conservative Party leadership contest on Tuesday.

The former foreign secretary, who was widely expected to win the leadership race, is set to officially become prime minister on Wednesday once Theresa May has notified Queen Elizabeth II of her resignation.

Johnson beat his rival, current foreign secretary Jeremy Hunt, by a margin of 92,153 votes to 46,656, Dame Cheryl Gillan, the co-chair of the party's parliamentary group, told the crowd gathered at the Queen Elizabeth II Centre, near the Houses of Parliament.

In his victory speech, Johnson began by acknowledging his varying popularity in the party, saying: "I know that there will be people around the place who will question the wisdom of your decision, and there may even be some people here who still wonder quite what they have done."

He went on to say he had three priorities taking office: to "deliver, unite and defeat".

He added that the slogan made the acronym "dud" until you added the final element, "energize," which, in fact, made it "dude".

Johnson said: "I say to all the doubters, dude, we are going to energize the country, we are going to get Brexit done on October 31, we are going to take advantages of all the opportunities it will bring in a new spirit of 'can-do' and we are once again going to believe ourselves and like a slumbering giant we are going to ping off the guy-ropes of self-doubt."

Around 87.4 percent of the 159,320 eligible Conservative Party cardholders decided the UK's next PM.

He is to confirm his new role on Wednesday before giving a speech to the nation outside 10 Downing Street, the PM's official residence in London.

Hunt offered his congratulations to the prime minister-designate, as did the outgoing May, saying she would offer her full support from the backbenches.

"We now need to work together to deliver a Brexit that works for the whole UK and to keep Jeremy Corbyn out of government," she said.

Corbyn, leader of the opposition Labour Party, took a different approach saying Johnson had won the support of fewer than 100,000 "unrepresentative Conservative Party members" but not the support of the country.

Further afield, US President Donald Trump said: "Congratulations to Boris Johnson on becoming the new Prime Minister of the United Kingdom. He will be great!"

The EU's chief Brexit negotiator Michel Barnier said he looked forward to working with Johnson on the ratification of the withdrawal agreement to achieve an "orderly Brexit".

Johnson has been a vocal critic of the withdrawal agreement, deeming it over-conciliatory and leaving the UK in danger of becoming a "vassal state" to the EU.

His nomination as Tory leader resonated in the party in the form of a ripple of resignations, many of which had been expected.

Chancellor of the Exchequer Phillip Hammond said he would resign on Wednesday.

On Tuesday, development secretary and former leadership contender Rory Stewart; justice secretary David Gauke and skills minister Anne Milton all resigned.

Alan Duncan, foreign minister, a less senior posting than a secretary of state in the UK, resigned on Monday.

Former London Mayor Johnson is expected to outline his new cabinet shortly after he is officially recognized as PM.

He backed the Leave campaign in the run-up to the Brexit referendum in June 2016. EFE-EPA