LONDON (AP) — Boris Johnson took over as Britain's prime minister Wednesday, vowing to break the impasse that defeated his predecessor by leading the country out of the European Union and silencing "the doubters, the doomsters, the gloomsters" who believe it can't be done.

But the brash Brexit champion faces the same problems that flummoxed Theresa May during her three years in office: heading a government without a parliamentary majority and with most lawmakers opposed to leaving the EU without a divorce deal.

Johnson has just 99 days to make good on his promise to deliver Brexit by Oct. 31 after what he called "three years of unfounded self-doubt."

He optimistically pledged to get "a new deal, a better deal" with the EU than the one secured by May, which was repeatedly rejected by Britain's Parliament.

"The people who bet against Britain are going to lose their shirts," he said, standing outside the shiny black door of 10 Downing St.

Trying to avoid the political divisions that plagued May, Johnson swept out many of her ministers to make way for his own team, dominated by loyal Brexiteers. He appointed Sajid Javid to the key role of Treasury chief, named staunch Brexit supporter Dominic Raab as foreign secretary and made Priti Patel the new home secretary, or interior minister. Michael Gove, who ran the 2016 campaign to leave the EU alongside Johnson, also got a Cabinet job.

Over half of May's Cabinet is gone, including ex-Foreign Secretary Jeremy Hunt, Johnson's defeated rival for the Tory leadership, who said he had turned down the chance to stay in government in a different job.

In his first speech as prime minister, Johnson unleashed a scattershot spray of promises — from more police on the streets to ending a ban on genetically modified crops to faster internet access.

To the many critics of the polarizing politician who find the phrase "Prime Minister Boris Johnson" jarring, it was typical of a verbal vim that is not always wedded to hard facts .

For the 55-year-old Johnson, walking into the Downing Street residence was the culmination of a life's ambition. The flamboyant, Latin-spouting former London mayor and foreign secretary helped lead the 2016 campaign to get Britain out of the EU and is now the darling of Brexit backers who feel frustrated that, three years later, the country is still in the bloc.

Judging by his words on Wednesday, Johnson's approach to the EU will be a mix of charm and threats.

He vowed to keep relations with the EU "as warm and as close and as affectionate as possible" and promised the 3 million EU nationals in Britain "absolute certainty" that they can stay. May made the same promise, but it still is not enshrined in law.

In the next breath, Johnson said Britain might be forced to leave with no deal if "Brussels refuses any further to negotiate" — trying to pin the blame for any future failure on the bloc. That's not an approach likely to win the trust and confidence of EU leaders.

The EU is adamant it will not renegotiate the agreement struck with May on the terms of Britain's departure and the framework of future relations. Without it, Britain faces a chaotic Brexit that economists warn would disrupt trade by imposing tariffs and customs checks between Britain and the bloc, send the value of the pound plummeting and plunge the U.K. into recession.

Chief EU Brexit negotiator Michel Barnier said "we are ready to listen and to work with" Johnson, but he did not budge on the bloc's refusal to alter the deal.

"A no-deal Brexit will never be, never, the choice of the EU. But we are prepared," he said in Brussels before Johnson spoke.

Johnson's political opponents accused him of offering little more than hot air.

"Rhetoric and reality are two different things," said Labour Party Brexit spokesman Keir Starmer.

Scottish First Minister Nicola Sturgeon tweeted that Johnson's speech was "rambling, blame-shifting and, to put it mildly, somewhat divorced from reality."

Wednesday's carefully choreographed political drama unfolded with May attending the weekly Prime Minister's Questions period in the House of Commons for the last time . The usually boisterous session was subdued, with Conservative colleagues praising May's sense of duty and opposition leaders offering best wishes.

As she left the chamber, May received a standing ovation from Conservative lawmakers, many of whom helped bring her down by rejecting her Brexit deal.

Later, she stood in Downing Street alongside her husband Philip and said it had been "the greatest honor" to serve as prime minister. She then went to Buckingham Palace to tender her resignation to Queen Elizabeth II.

Moments after her Jaguar left the palace, Johnson swept in to see the queen and be appointed the 14th prime minister of her 67-year reign. Her first was Winston Churchill, who is idolized by Johnson.

There was a brief hiccup in the smooth handover when Greenpeace climate-change protesters blocked Johnson's car by forming a human chain on the road outside the palace. They were quickly moved aside by his police escort. Later, hundreds of people demonstrated in central London against Johnson's support for Brexit and past offensive remarks about Muslims, women and others.

If he is to succeed, Johnson must win over the many Britons opposed to Brexit and resistant to his blustering charisma.

In a sign he hopes to move beyond the largely white, male and affluent Conservative members who chose him as their leader, Johnson's office said his government would be a "Cabinet for modern Britain" with more women and a record number of ministers from ethnic minorities.

His administration is also set to include some pro-EU politicians, but most will be strong Brexit supporters. One of his senior advisers is set to be Dominic Cummings, lead strategist for the 2016 referendum.

A contentious figure, Cummings was found to be in contempt of Parliament earlier this year for refusing to give evidence to a committee of lawmakers investigating "fake news."

British lawmakers are due to start a six-week summer break on Friday. When they return in September, Johnson looks set for a fight with lawmakers, a majority of whom oppose leaving the EU without a deal.

That has led to speculation he could call a snap election in hopes of gaining a majority in Parliament for his plans.

Political commentator Matthew Parris, a former Conservative lawmaker, said Johnson was about to find out whether the skills that have brought him to power would work in government.

"However far excitement, energy, positivity can take you ... they will take Boris Johnson that far," he said. "But there is a limit."

___

Follow AP's full coverage of Brexit and the Conservative Party leadership race at: https://www.apnews.com/Brexit

Copyright 2019 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.