LONDON—Boris Johnson’s first act as British prime minister was to launch himself on a spectacular collision course with reality.

Instead of pivoting towards conciliation as he stood on the steps of Downing Street, the new Conservative leader lashed out at the “doomsters” and “gloomsters” who have failed to extricate Britain safely from the European Union over three agonizing years of negotiation at home and abroad.

Even before the Queen formally invited him to become Britain’s next prime minister, a raft of anti-Johnson Conservative lawmakers had quit the government in protest. The new PM chose to respond with a purge of his opponents in the most savage cabinet reshuffle in decades and the appointment of one of the most controversial bomb-throwers in Westminster as his senior adviser.

Johnson, who led the Leave campaign during the Brexit referendum, claims he can solve the Brexit conundrum in just three months. It’s either a pledge of great bravery or colossal hubris. Either way it is very likely that it will lead to Johnson putting the keys to No. 10 on the line in an early general election.

Twice on Wednesday he repeated the campaign pledge made to Conservative Party members, who selected him to replace Theresa May, that he would have Brexit wrapped up by Halloween. He says he wants Britain to leave the European Union with a new deal, which means either convincing Europe to abandon the red lines it's stuck to since 2016 or forcing the House of Commons to change its mind and approve a version of May’s deal that was brutally rejected by lawmakers on three occasions.

The only other option is to take Britain out of the E.U. without a deal, which parliament also has voted against repeatedly. He could try and force a No-Deal Brexit through against the will of Parliament, but that would break with centuries of political precedent.

Johnson finds himself in an almost impossible position. It’s going to take more than optimism to secure Britain’s exit from the E.U., but he made it clear that he would take personal responsibility for doing just that. “The buck stops here,” he said, as crowds of protesters booed and shouted over his first speech as prime minister.

If Parliament won’t let him deliver what he has promised to deliver, he’s going to need a new Parliament—and that means an election.

The big strategic question facing Johnson on the first night in the apartment above his new offices at No. 10 is whether to face up to reality before he crashes headfirst into the obstinacy of EU leaders and parliamentary opponents, or wait until after the damage has been done.

If he spends the three months trying to negotiate a new deal with Europe and convince a skeptical parliament to accept it, he runs the risk of being forced into an election soon after October 31 when he has failed to deliver his trademark pledge. Nigel Farage’s Brexit Party is waiting in the wings and ready to crush the Conservatives just as they did in this year’s European elections.

The alternative would be Johnson calling a snap election ahead of the deadline and asking the nation to back his vision by returning a more strongly pro-Brexit set of lawmakers to rubberstamp his approach.

Either of those scenarios could leave him at risk of usurping George Canning, who was Britain’s shortest-serving prime minister—in office from April 1827 for 119 days until his premature death at the age of 57.

Johnson’s best chance of avoiding that ignominy is to convince the current parliament to back whatever deal he can eke out of Brussels. Unfortunately for him, May has handed over a tiny working majority of just two lawmakers in the House of Commons, which means Johnson will be sweating over every vote.

The parliamentary arithmetic makes Johnson’s cabinet reshuffle all the more surprising. By losing at least half of the cabinet of lawmakers he inherited from May, Johnson has created a whole host of new enemies.

He fired Jeremy Hunt, his final opponent for the leadership, as well as Hunt’s backers Liam Fox and Penny Mordaunt, even though they were arch-Brexiteers. The Remain-leaning lawmakers have also been booted out of a cabinet that May had tried to balance between the rival factions.

Johnson has disregarded that notion and appears to be rebuilding the Vote Leave organization inside No. 10.

One outgoing minister told The Daily Beast: “It’s the Brexiteers’ wet dream of a Cabinet. The test is whether securing, as they have, every office of state they can now deliver Brexit. Backs to the wall, Dunkirk spirit, underdog rhetoric won’t be enough. The clock is ticking and all hinges upon success—the prime minister, the government, the party, the country.”

Perhaps the clearest sign that Johnson is planning a scorched earth policy rather than looking to build consensus is his choice of Dominic Cummings as senior adviser. Cummings was portrayed as the genius behind the Brexit referendum win—played by Benedict Cumberbatch in a recent HBO movie—but he is also known as one of the most abrasive characters in politics.

He became one of the few people in modern times to be found in contempt of parliament earlier this year for refusing to appear at a committee hearing, and former Prime Minister David Cameron once reportedly described him as a “career psychopath.”

Cummings has been scathing not just about his Brexit opponents but many of those on the same side. He attacked the group of hardline Brexiteers whom May struggled to control, saying they should be “treated like a metastasizing tumor and excised from the U.K. body politic.”

He described the pro-Brexit lawmaker tasked with negotiating the May deal as “thick as mince and lazy as a toad.”

Cummings is also renowned as an electoral strategist, raising the prospect that he has been appointed to help oversee an impending election, or perhaps even a second referendum, if that becomes the only option left on the table.

Johnson has sidelined the party’s big beasts and surrounded himself with a cadre of political outsiders like Cummings and his new Home Secretary (interior minister) Priti Patel, who was forced out of May’s cabinet when it emerged that she had been holding secret meetings with the Israeli government behind the prime minister’s back.

Johnson likes to ham up comparisons between himself and Winston Churchill, but after writing a biography of the leader who prevailed against Hitler in World War II he should know that Churchill’s over-ambitious and under-prepared early forays did not always end in success.

In World War I, Churchill drew up a bold plan to open a second front by attacking the Ottoman Empire, but he was not granted the number of troops he requested. In a fit of blind optimism over reality, Churchill ordered an amphibious attack on what is now Turkey to go ahead anyway. The result was the notorious bloodbath at the Battle of Gallipoli.

Additional reporting by Jamie Ross.