The former London mayor easily beat his rival, Foreign Secretary Jeremy Hunt, in a vote of members of the governing Conservative Party.
He is expected to be confirmed as prime minister on Wednesday, when his predecessor Theresa May formally tenders her resignation to Queen Elizabeth II.
US President Donald Trump was the first world leader to offer his congratulations, saying: “He will be great!”
It is a triumph for a man who has always wanted the top job, but Johnson, known for his jokes and bluster, is taking over at a time of immense political upheaval.
Three years after the referendum vote to leave the European Union, Britain remains a member amid continued wrangling in a divided parliament on how to proceed.
‘We’ll get Brexit done’
Johnson led the 2016 Brexit campaign and – after May delayed Brexit twice – insists the latest deadline must be kept, with or without a divorce agreement with the EU.
“We’re going to get Brexit done on October 31,” he declared after winning 66% of almost 160,000 votes cast.
However, Brussels says it will not renegotiate the deal it struck with May to ease the end of a 46-year partnership – even after MPs rejected it three times.
EU negotiator Michel Barnier said he wanted to work with Johnson “to facilitate the ratification of the withdrawal agreement and achieve an orderly #Brexit”.
But he said he was ready to “rework” an accompanying declaration on future UK-EU ties.
Although parliament dislikes May’s deal, Johnson faces significant opposition from MPs to his threat to leaving with no deal, including from Conservative colleagues.
Several ministers said they will not serve under Johnson, warning that severing ties with Britain’s closest trading partner with no new arrangements is deeply irresponsible.
But addressing Conservative members after his win, Johnson insisted with his trademark optimism that he would find a way through the deadlock.
“Like some slumbering giant we are going to rise and ping off the guy ropes of self-doubt and negativity,” he said.
‘Brilliant or a disaster’
Johnson promised to “work flat out from now on”, saying he would announce his top team in the coming days.
But Westminster is watching for any early challenge which could stop him automatically becoming prime minister.
May’s government has a majority of just two in the 650-seat House of Commons, made possible through an alliance with Northern Ireland’s Democratic Unionist Party (DUP).
The main opposition Labour party is not expected to force a confidence vote this week – but some in his own party have already tried.
Junior foreign minister Alan Duncan, who quit this week, revealed he had sought to force a vote on Tuesday but was blocked by Commons Speaker John Bercow.
However, other colleagues who do not agree with Johnson are still willing to give him a chance.
“I think he needs to be given an opportunity to go out there to engage with the European Commission,” outgoing justice minister David Gauke told BBC radio.
MPs are expected to go on their summer holidays on Friday (July 26), giving Johnson some breathing room over the summer to try to get a new Brexit deal.
But when he returns, if “no deal” looks likely, many MPs have vowed to stop him – a move that could trigger an early election.
Opposition Labour leader Jeremy Corbyn challenged Johnson on Tuesday to call a vote, although both his party and the Tories are struggling amid a splintering of support among a public deeply divided over Brexit.
They face a challenge from Nigel Farage’s eurosceptic Brexit Party on one side, and the pro-EU Liberal Democrats on the other.
Outside parliament, where pro- and anti-Brexit protesters gather daily, reaction to Johnson’s win was mixed.
“What a disaster!” said Janet Ellis, 68, who opposes Brexit. But eurosceptic Michelle Pearce, 64, said: “It’s the most we can hope for.”
“He’ll be brilliant or a disaster,” Pearce said.
Johnson’s domestic battles might have to take a backseat during his first days in office as he manages tensions with Iran.
The Islamic republic seized a UK-flagged tanker in the strategic Strait of Hormuz last Friday (July 19) – two weeks after UK authorities detained an Iranian tanker off Gibraltar.
The standoff comes amid escalating tensions between Iran and the United States over the Islamic republic’s nuclear ambitions.
Iranian Foreign Minister Mohammad Javad Zarif tweeted his congratulations to Johnson, saying: “Iran does not seek confrontation.
“But we have 1500 miles of Persian Gulf coastline. These are our waters & we will protect them.”