Just over two years after he won a landslide general election victory, the Brexit figurehead again proved his ability to escape political hot water to maintain his grip on power.
But the "Partygate" controversy over lockdown-breaking events at Downing Street, which saw him become the first serving UK prime minister to have broken the law, has still severely weakened his position.
While 211 Tory MPs backed him, 148 did not.
Johnson, 57, needed the backing of 180 MPs to survive the vote, a majority of one out of the 359 sitting Conservatives in parliament.
Defeat would have meant an end to his time as party leader and prime minister until a replacement was found in an internal leadership contest.
In previous Tory ballots, predecessors Margaret Thatcher and Theresa May both ultimately resigned despite narrowly winning their own votes, deciding that their premierships were terminally damaged.
Johnson has steadfastly refused to resign over "Partygate".
He earlier defended his record on delivering Brexit, fighting the Covid pandemic and Britain's hawkish support for Ukraine against Russia.
"This is not the moment for a leisurely and entirely unforced domestic political drama and months and months of vacillation from the UK," he told Tory MPs, according to a senior party source.
"We have been through bumpy times before and I can rebuild trust," the prime minister told his parliamentary rank and file, according to the source, adding: "The best is yet to come."
Supporters could be heard cheering and thumping their tables in approval.
The source said Johnson had indicated tax cuts could be in the offing as Britain contends with its worst inflation crisis in generations.
But the scale of Tory disunity was exposed in a blistering resignation letter from Johnson's "anti-corruption champion" John Penrose and another letter of protest from long-time ally Jesse Norman.
The prime minister's rebuttals over "Partygate" were "grotesque", Norman wrote, warning that the Tories risked losing the next general election, which is due by 2024.
Ex-cabinet member Jeremy Hunt, who lost to Johnson in the last leadership contest in 2019 and is expected to run again if Johnson is deposed, confirmed he would vote against him.
"Conservative MPs know in our hearts we are not giving the British people the leadership they deserve," Hunt tweeted.
After a dismal showing in May local elections, the party is expected to lose two by-elections this month, one of them in a previously rock-solid Conservative seat.
That is focusing the minds of Tory lawmakers, who fear their own seats could be at risk if Johnson leads them into the next election, which is due by 2024 at the latest.
In a snap poll by Opinium Monday of 2,032 people, 59 percent of respondents said the Tories should ditch him as leader.
Among Conservative members, 42 percent want MPs to fire Johnson, according to another poll by YouGov.
Johnson was booed Friday by sections of an ardently patriotic crowd gathered outside St Paul's Cathedral, ahead of a religious service for Queen Elizabeth II's Platinum Jubilee.
For wavering Tories, the barracking at a televised national occasion reportedly marked a turning point. Some said they had held back on public criticism of Johnson until after the jubilee.
But cabinet ally Jacob Rees-Mogg dismissed the booing as "muted noise" and insisted that Johnson could survive with the slenderest of majorities.
"He has shown himself to be a good, strong leader who gets the big decisions right, and he has a mandate from the British people," Rees-Mogg told reporters.
Graham Brady, who heads the backbench committee of Conservatives which oversees party challenges, had earlier confirmed that the threshold of 54 Tory lawmakers seeking a confidence vote -- or 15 percent of its MPs -- had been met.
Brady told reporters that he had informed Johnson early on Sunday -- as four days of jubilee celebrations ended -- and that the prime minister had not objected to a rapid ballot.
In a message of thanks for the celebrations of her record-breaking 70-year reign, the queen had expressed hope that "this renewed sense of togetherness will be felt for many years to come".
Conservative MPs had other ideas, as they openly squabbled on Twitter in often-scathing terms following Brady's announcement.
Dozens have broken ranks and criticised Johnson after an internal probe into "Partygate" said he had presided over a culture of Covid lockdown-breaking parties in Downing Street.
Some ran late into the night, and one featured a drunken fight among staff, at a time when the government's pandemic rules forbade ordinary Britons from bidding farewell in person to dying loved ones.