LONDON — Boris Johnson doubled down on his promise to take Britain out of the European Union on Oct. 31 in his first speech as prime minister Wednesday, and called for optimism in the face of a looming Brexit deadline.

"I have every confidence, in 99 days' time we will have cracked it," the New York-born former mayor of London said on the steps of No. 10 Downing Street. "But we aren’t going to wait 99 days because the British people have had enough of waiting. The time has come to act."

The flamboyant journalist-turned-politician has given himself three months to deliver Brexit, with Britain leaving the E.U. at the end of October regardless of whether his government can strike a new deal with the bloc's negotiators.

Renewing a theme he has deployed recently, Johnson described critics as "doubters, doomsters and gloomsters," and said Britain would honor its democratic mandate to leave the E.U.

"No one in the last few centuries has succeeded in betting against the pluck, nerve and ambition of this country," he said in an apparent reference to intractable disputes over whether and how to leave the E.U. "They will not succeed now."

Johnson, 55, whose full name is Alexander Boris de Pfeffel Johnson, assumed office earlier Wednesday after an audience with the queen at the Buckingham Palace. This came after he was chosen as leader of the ruling Conservative Party on Tuesday.

He arrived at the palace in central London after climate change protesters attempted to block his motorcade by forming a human chain across the road that leads to its gates. The protesters were quickly swept aside by police.

After meeting the queen, Johnson headed to No. 10 Downing Street, the official residence of the nation's leaders, where he gave the speech before appointing key members of his government.

Queen Elizabeth II welcomes newly elected leader of the Conservative Party Boris Johnson to Buckingham Palace on Wednesday. Victoria Jones / Pool via AP

Johnson, Britain's 77th prime minister and the 55th person to hold the job, takes office at one of the most critical junctures in Britain's post-World War II history.

The country is bitterly divided over Brexit. Johnson also faces escalating tensions with Tehran after Iranian commandos seized a British-flagged oil tanker in the Strait of Hormuz last week. Earlier this month, Britain seized an Iranian vessel it suspected of transporting embargoed oil to Syria.

The new prime minister, who has followed a well-trodden path to the top of British politics — he attended the elite boarding school, Eton College, before heading to Oxford University — will need to try to heal a country exhausted by a decade of post-2008 financial crisis austerity.

He faces an uphill battle to renegotiate the E.U. withdrawal deal that his predecessor, Prime Minister Theresa May, painstakingly hammered out with the 27 other leaders of E.U. member states.

Moments after Johnson's election, the E.U. reiterated its position that it will not reopen the divorce deal negotiated by May. If he is unable to persuade E.U. leaders to change their minds, Johnson has pledged to leave the bloc without a deal.

Many experts and industry leaders warn that a "no-deal" Brexit could spell economic disaster for Britain, not to mention its closest European neighbors. It could also trigger shortages of food, medicine and basic supplies.

Johnson said while he did not seek a no-deal Brexit, it was “common sense" to be prepared.

“If there is one thing that has really sapped the confidence of business over the last three years, it is not the decisions we have taken it is our refusal to take decisions,” he said.

He added that he wanted to “create a new partnership with our European friends — as warm and as close and as affectionate as possible.” And he reaffirmed his commitment to guarantee the rights of the millions of E.U. nationals living in the U.K. to remain after Brexit.

Because of the way the U.K.'s political system works, there was no general election needed for Johnson to become prime minister. He assumes the role having won the leadership contest for the Conservative Party, which is the largest in Parliament.

Some 140,000 party members voted, with Johnson defeating his opponent, Foreign Secretary Jeremy Hunt, by 92,153 votes to 46,656.

While the pro-Brexit lawmaker is championed by his supporters for his energy and charisma, he is derided by his critics as a court jester with little regard for the truth.

In a final appearance before becoming Conservative Party leader last week, Johnson brandished a kipper — a kind of smoked herring that is a traditional British breakfast food — in front of the crowd, and claimed that "pointless" E.U. regulations had forced a fish seller on the Isle of Man to package his fish with “ice pillows.”

Boris Johnson holds up kipper at an event in London on July 17. Tolga Akmen / AFP - Getty Images file

Within hours, European leaders pointed out that the case in question fell outside the scope of E.U. legislation. Commentators added that the Isle of Man was not actually part of the E.U.

Beyond Johnson's penchant for headline-grabbing stunts, during the leadership campaign much scrutiny focused on his tumultuous personal life.

Johnson was once fired from a senior Conservative post for lying about an extramarital affair and his reported infidelities and cover-ups would have been enough to sink most other politicians.

He has refused to answer journalists’ questions about the number of children he has. Last month at the height of the leadership campaign, Johnson’s private life was back in the headlines after a recording of “a loud altercation involving screaming, shouting and banging” at the home of his girlfriend was passed to the Guardian newspaper.

Regardless of the scandals, President Donald Trump has already voiced his support for Johnson as the next prime minister.

“I think Boris would do a very good job. I think he would be excellent,” Trump told British newspaper The Sun ahead of a state visit to the U.K. in June.

And Trump was one of the first world leaders to tweet his congratulations to Johnson on Tuesday.

For his part, Johnson has criticized Trump in the past, saying in 2015 that the then-candidate Trump was “clearly out of his mind” for suggesting that there should be a ban on Muslims entering the U.S.

More recently, however, Johnson has been reluctant to criticize the president. Earlier this month, he refused to condemn Trump’s remarks over the leaked cables of British Ambassador Kim Darroch, who stepped down from his post under pressure.

The relationship with the U.S. will be crucial for Britain as it tries to exit the E.U.

CLARIFICATION (July 24, 2019, 3:20 p.m. ET): An earlier version of this article referred imprecisely to the history of the prime minister's office. Though there have been 77 terms of office of British prime ministers, only 55 individuals have served as prime minister, Johnson being the latest occupant of the office.