LONDON — Boris Johnson faces perhaps the most daunting immediate challenge of any incoming British prime minister since Winston Churchill during World War II.

During Johnson's leadership campaign, it appeared his most urgent crisis would be what to do about Brexit, the United Kingdom's intractable attempts to leave the European Union.

But in recent days, the U.K. has been pulled headfirst into a standoff with Iran, and with it a delicate balancing act between Washington and Europe in terms of how to respond.

Longer-term, Johnson, among the most divisive political figures in the U.K., must heal bitter divisions within his own party, not to mention the wounded country as a whole.

Johnson will officially start in the job Wednesday. Here are his main challenges:

Avoid conflict with Iran

Less than a week before Johnson was elected as the U.K.'s next leader, masked Iranian commandos rappelled onto a British-flagged oil tanker in the Strait of Hormuz, seizing the vessel and detaining its 23 crew.

Tensions in the region have been on the rise since President Donald Trump withdrew from the Iran nuclear deal last year. In the past two months, they have risen sharply, with Tehran blamed for sabotaging tankers in the Gulf and Washington bolstering its regional military presence.

Earlier this month, Britain seized an Iranian ship it suspected of carrying embargoed oil to Syria. Iran detaining one of its vessels last week brought the U.K. right into the heart of the dispute.

In response, British Foreign Secretary Jeremy Hunt said Monday he was negotiating with European countries to establish a "maritime protection mission." Hunt said this would dovetail with a similar U.S.-announced plan, but he made it clear there remains a difference of opinion with Washington on the issue of the 2015 nuclear deal.

British oil tanker Stena Impero Stena Bulk / AP

How Johnson's fledgling premiership will deal with this multilayered dispute remains unclear. Hunt announced the maritime task force while he was running against Johnson as leader — will his former opponent stick with it once he's in office?

Although he has criticized Trump in the past, Johnson has more recently been reluctant to speak out against the president, refusing to condemn Trump's remarks over the leaked cables of British Ambassador Kim Darroch.

Furthermore, Johnson's critics say he is ill-equipped to deal with such a delicate international crisis. His foreign policy record is chequered, to say the least, and his opponents can point to a litany of gaffes, blunders and outright offensive language.

During his brief stint as foreign secretary, Johnson made comments about a detained British-Iranian woman, Nazanin Zaghari-Ratcliffe, which the Iranian regime pointed to as evidence of her guilt.

This week, Iran's foreign minister, Javad Zarif, was quick to congratulate Johnson on his leadership victory, but also warning that while Iran "does not seek confrontation … these are our waters and we will protect them."

Solve the Brexit riddle

Assuming he can avoid conflict with Iran, Johnson will still have to deal with the skyscraper-sized shadow that's been looming over British politics for more than three years: Brexit.

The U.K. voted to leave the European Union in June 2016 but reality hasn't been simple.

The last prime minister, Theresa May, agreed to a divorce deal with E.U. leaders, setting out how this mind-bendingly complicated process should begin. But British lawmakers — including a sizable rebellion within her own Conservative Party — refused to give it their approval.

Johnson, who helped spearhead the Brexit campaign, has vowed to succeed where she failed, pledging to renegotiate his own deal with Europe in a fraction of the time. But moments after his election, E.U. officials reiterated what they have been saying for months: they have no plans to reopen the deal that they agreed with May last year.

Theresa May announces her resignation outside 10 Downing Street on May 24. DANIEL LEAL-OLIVAS / AFP - Getty Images

If he can't thrash out a new agreement, Johnson says he's prepared to go where May drew the line, and steer Britain out of the E.U. without a deal at all.

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

Johnson's supporters believe that his blend of superstar charisma and rapier intellect can find a solution to this impasse by sheer force of personality. In one of his recent newspaper columns for the Daily Telegraph, the incoming prime minister said that Britain could resolve Brexit by employing the American "can-do spirit" of the 1960s that put the first men on the moon.

His detractors argue this is emblematic of their fears about Johnson, that he is all style and no substance. They say that all the can-do spirit in the world does nothing for the seemingly unsolvable riddles that have left Brexit in the mire since 2016.

One E.U. commissioner, Vytenis Andriukaitis, wrote Tuesday that Johnson has undermined democracy with "cheap promises, simplified visions, blatantly evident incorrect statements."

Unite his party — and the country

Part of the problem is that Brexit disobeys all of the rules that have kept British politics motoring along for decades.

Both the main parties, Johnson's Conservatives and the opposition Labour Party, are deeply divided, with lawmakers on both sides of the aisle passionately for and against Brexit.

There is no majority in Parliament for any single course of action. Time and again, members of Parliament have voted and debated in the strongest terms against what they don't want, while never agreeing on what they do.

The divisions are so severe within Johnson's ruling Conservative Party that several MPs have vowed to topple their own government rather than see him push through a no-deal Brexit.

Boris Johnson leaves his campaign headquarters in London on July 23. Isabel Infantes / AFP - Getty Images

The Conservatives lost so many votes at the last election in 2017 that they now rule as a slender minority, propped up only by Northern Ireland's Democratic Unionist Party. This knife-edge means Johnson is particularly beholden to even the slightest hint of rebellion.

If he leans too far the other way, pursuing any form of "softer Brexit" — keeping some E.U. rules even temporarily — there are dozens who have pledged to block that, too.

This raises the possibility of a general election before the year is over. This electoral fight might see Johnson outflanked from the right by the Brexit Party led by Nigel Farage, the anti-immigration Trump ally who was one of the leading lights of the Brexit referendum.

A key bellwether will be a one-off election in the constituency of Brecon and Radnorshire next week, held because the incumbent lawmaker was kicked out following a false expenses claim.

Heavy defeat there would not only further reduce Johnson's minority rule in Parliament but also serve as a symbolic blow for an ailing party. Were he to lose a general election this year, Johnson's would be the shortest time in office in 200 years.