(Bloomberg) -- Boris Johnson, the public face of the Brexit campaign, won the contest to succeed Theresa May as British prime minister, taking over a country in crisis and a government on the brink of breaking apart.

After a six-week leadership race, which he led from the start, Johnson defeated his rival Foreign Secretary Jeremy Hunt in a ballot of the Tory party’s 180,000 members.

The result marks the end of a bruising battle for the biggest job in British politics and the start of what threatens to be a brutal new phase in the civil war inside the government over Brexit.

The incoming prime minister has just 100 days to negotiate a new divorce deal with the European Union before the U.K. is due to leave the bloc at the end of October.

He must do so despite opposition from the EU and a growing rebellion from his own colleagues, including a group of ministers quitting the government because they can’t work for him.

The rebels inside the party Johnson now leads are vowing to fight his policy of exiting the EU with or without a deal -- “do or die” -- by the hard deadline of Oct. 31. Adding to his problems is the Tories’ lack of an automatic majority in Parliament -- and Democratic Unionist Party, the small Northern Irish grouping that props up the Conservatives, wants to renegotiate the terms of its continuing support.

War-Gaming

Even with the DUP on board, Johnson’s majority is perilously small, after a number of defections and defeats. Some Conservative believe a general election is inevitable and Johnson’s team have been war-gaming their options for a snap poll in the fall.

Victory is a personal triumph for Johnson, who quit the prestigious role of foreign secretary a year ago and was dismissed by many colleagues, including some of his own supporters, as a failure whose time had been and gone.

Johnson tried to run for the premiership in 2016, when David Cameron resigned after losing the EU referendum to his pro-Leave campaign. But his fledgling leadership bid was killed off before it launched when his friend Michael Gove quit as his campaign chief and decided to run as a rival because he did not believe Johnson was up to the job.

‘Backstop’

The former foreign secretary got a second chance when May finally conceded defeat in her attempt to honor that referendum and resigned. The Brexit deal she spent two years negotiating with the EU was rejected three times in Parliament and Johnson must now find a way through where she failed.

He has declared May’s Brexit agreement to be “dead” and has vowed to secure better divorce terms by the Oct. 31 deadline for Britain to leave the bloc.

Johnson’s main aim is to strip out the so-called backstop guarantee plan for the Irish border, a protocol designed to ensure there’s never a hard frontier with checkpoints and security guards at the land border between Ireland and the U.K.

The EU has flatly rejected this, saying any exit deal must include the backstop. If nothing changes, that puts Johnson on course to crash the U.K. out of the bloc at the end of October without any deal at all.

He has promised to step up preparations for a no-deal Brexit, to ensure the inevitable economic damage and disruption to trade are minimized, as far as possible. That rising prospect of a messy split from the EU has weighed on the pound in recent weeks.

A New Prime Minister’s First Day in No. 10: A Step-By-Step Guide

Johnson is due to take over from May as prime minister on Wednesday, when he visits Queen Elizabeth II at Buckingham Palace to be formally appointed to the role. In the hours that follow, he’s expected to appoint a new Cabinet before making a speech to Parliament on his Brexit plans on Thursday. He will have to decide whether to give top jobs to his two biggest rivals: Gove and Hunt.

While the U.K.’s divorce from the EU is the most daunting policy priority for Johnson, he has other demands competing for his attention, including the escalating tensions with Iran over the break down of the nuclear deal and the seizure of a British oil tanker in the Persian Gulf.

--With assistance from Alex Morales and Robert Hutton.

To contact the reporter on this story: Tim Ross in London at tross54@bloomberg.net

To contact the editors responsible for this story: Flavia Krause-Jackson at fjackson@bloomberg.net, Caroline Alexander, Emma Ross-Thomas

©2019 Bloomberg L.P.