Liz Truss must now steer the UK through, health, economic and diplomatic emergencies, as Political Editor Robert Peston reports
The foreign secretary won 57% of the votes with 81,326, while the former chancellor secured 43% with 60,399.
Ms Truss will become the UK's third ever female prime minister, following in the footsteps of her avowed political idol Margaret Thatcher, and Theresa May.
She also marks the fourth prime minister in just six years - three of which won the keys to No 10 without running in a General Election first.
More than 142,000 Conservative Party members voted meaning that less than 0.3% of the UK population of 67.1 million was able to directly choose the new leader.
However, in her victory address, Ms Truss suggested there would be no General Election until 2024, appearing to dismiss Labour and Lib Dems' calls for a snap poll.
The result was not quite the landslide Ms Truss and her supporters had expected. The margin was closer than predicted - and lower than her predecessors.
Boris Johnson won by 66% of the vote in 2019, David Cameron secured 68% in 2005, and Iain Duncan Smith received 61% in 2001.
Ms Truss will replace Mr Johnson on Tuesday afternoon when the Queen formally asks her to form a government at her Balmoral residence in Scotland, in an historic first.
The foreign secretary - the clear frontrunner for much of the six-week contest - now faces one of the most challenging in-trays of any British peacetime leader.
Pressure has been mounting to reveal how she will tackle the soaring cost of living, spiralling energy bills, the highest inflation rates since the 1980s, an NHS and criminal justice system in crisis - and deepening tensions abroad amid Russia's invasion of Ukraine.
Speaking on the eve of the leadership announcement, Ms Truss vowed to act on soaring energy costs within a week if she was chosen to lead the party, after facing weeks of criticism for failing to outline any plans of support for struggling families and businesses.
After the result was read out, a beaming Ms Truss was filmed walking past Mr Sunak without shaking his hand as she took to the stage to accept the mantle of the next leader of the Tory party.
In her victory speech she thanked Tory members for putting their "faith" in her to lead the "greatest political party on earth" and promised to take immediate action over energy bills.
She also took a moment to pay homage to her predecessor and "my friend" Mr Johnson, who she said was "admired from Kyiv to Carlisle".
"Boris, you got Brexit done, you crushed Jeremy Corbyn, you rolled out the vaccine and you stood up to Vladimir Putin," she said, to delayed applause from the audience.
She told the crowd before receiving a standing ovation: “I will deliver a bold plan to cut taxes and grow our economy.
“I will deliver on the energy crisis, dealing with people’s energy bills but also dealing with the long-term issues we have on energy supply.”
Confidently declaring she will lead the party to triumph at the next General Election, she said: “Because my friends, I know that we will deliver, we will deliver and we will deliver.
“And we will deliver a great victory for the Conservative Party in 2024.”
Defeated Tory leadership contender Mr Sunak thanked everyone who voted for him and said: “It’s right we now unite behind the new PM, Liz Truss, as she steers the country through difficult times.”
A flurry of current Cabinet members and former prime ministers rushed to congratulate Ms Truss saying they were "delighted" with the result, while Mr Johnson said his successor “has the right plan to tackle the cost of living crisis, unite our party and continue the great work of uniting and levelling up our country”.
But two top Tories - and staunch Johnson allies - resigned shortly after the result.
First, Ben Elliot stepped down as Conservative Party co-chairman.
Some hours later, Priti Patel resigned as home secretary and announced her return to the backbenches, telling Mr Johnson it had been the "honour of my life" to serve in the role.
Leader of the opposition Sir Keir Starmer congratulated Ms Truss but in the same breath slammed her for being "out of touch" and not being “on the side of working people”.
"We’ve heard far more from the latest prime minister about cuts to corporation tax over the summer than we have about the cost-of-living crisis, the single most important thing that’s bearing down on so many millions of households," the Labour leader said.
“There can be no justification for not freezing energy prices. There’s a political consensus that needs to happen. She needs to ask the question how she’s going to pay for that. Labour made it clear, it needs to be a windfall tax on oil and gas companies.
“So, she needs to show that she actually understands and can meet the challenges that are there after 12 years of failure of this Tory government.”
David Cameron said he "wishes the new government well" at "this time of global uncertainty".
Former Tory leadership candidate Penny Mordaunt said the Conservative Party now needs to unify behind their new leader, who she said has a plan to tackle the escalating cost of living crisis - despite Ms Truss repeatedly refusing to be drawn on exactly what that entails.
James Cleverly, currently education secretary and tipped to maintain a Cabinet role, agreed ministers need to "rally around" the next PM to tackle soaring bills but would not be drawn on reports that Ms Truss is considering a freeze on energy costs.
He said he believes the public will “warm” to her over time.
When asked whether he was concerned about Ms Truss being less popular with the public than her predecessor, he said: “Boris was a very, very popular prime minister and he’s still very, very popular with huge swathes of the country and people know him very well.
“But I have absolutely no doubt that the more they see of Liz, the more they get to know her, the more they will warm to her, which is exactly what we saw during this leadership competition.
What challenges does Liz Truss face as PM? Political Editor Robert Peston outlines what's ahead
Amid speculation over who Ms Truss will choose for her Cabinet and liberal Tories telling ITV News they fear they will see the "most right-wing Cabinet in 100 years".
Dominic Raab - a Sunak supporter - said he "certainly doesn't expect" to be picked for Ms Truss' "top team" in government and expects he'll be out of a job on Tuesday.
Mr Cleverly told ITV News it was "too early to speculate" who will secure the most coveted jobs.
James Cleverly, speaking to political reporter Libby Wiener, would not be drawn on reports that Ms Truss is considering a freeze on energy bills
The devolved nations shared stern words about their future relations with Ms Truss.
Scottish First Minister Nicola Sturgeon said she “will seek to build a good working relationship” with Ms Truss despite admitting their "political differences are deep".
“She must now freeze energy bills for people and businesses, deliver more cash support, and increase funding for public services," she added.
Welsh First Minister Mark Drakeford echoed her calls and urged Ms Truss to work with him to "save millions from hardship this winter", adding: “There is no more time to waste – action is needed now.”
Sinn Fein’s Stormont leader Michelle O’Neill urged the next PM to prioritise the restoration of powersharing in Northern Ireland.
However, DUP leader Sir Jeffrey Donaldson instead insisted that Ms Truss should concentrate on resolving issues caused by the Northern Ireland Protocol, and added there could be no return to powersharing without “decisive action” on the post-Brexit arrangement.
Archbishop of Canterbury Justin Welby said he was "praying" for the next PM "as she takes on the great responsibilities of leadership at a time of such significant challenges.
"May God guide her, and all who serve in our political life, towards His hope for our nation, and particular care for those who are vulnerable."
What happens next?
Mr Johnson will deliver his farewell speech as prime minister outside No 10 on Tuesday morning.
The outgoing PM and Ms Truss will then make the 1,000-mile round trip to the Queen's Scottish residence, Balmoral Castle, where Mr Johnson will tender his resignation to the monarch shortly after 11am.
Usually, the outgoing and incoming prime ministers would be received at Buckingham Palace, following a tradition that began with Winston Churchill.
Ms Truss will instead have an audience with the Queen at Balmoral, in which she will be formally appointed as the new leader of the Conservative Party and PM by default, and asked to form a government.
She will leave at about 12.40pm and will begin to appoint her Cabinet.