"It is clearly the will of the parliamentary Conservative party that there should be a new leader of that party, and therefore a new prime minister," Johnson said outside 10 Downing Street.
Johnson, 58, announced that he would step down after a slew of resignations from his top team in protest at his leadership but would stay on as prime minister until a replacement is found.
The timetable for a Tory leadership race will be announced next week, he said, after three tumultuous years in office defined by Brexit, the Covid pandemic and non-stop controversy over his reputation for mendacity.
The leadership election will take place over the summer and the victor will replace Johnson by the party's annual conference in early October, the BBC and others reported.
He said he was "sad... to be giving up the best job in the world" and justified fighting on in the final hours to deliver the mandate he won in a general election in December 2019.
In the frenzied hours building up to Johnson's announcement, opposition Labour leader Keir Starmer had welcomed his impending departure.
But Starmer said "a proper change of government" was needed and demanded a no-confidence vote in parliament, potentially triggering a general election, rather than Johnson "clinging on for months and months".
Even while eyeing the exit, Johnson on Thursday sought to steady the ship with several appointments to replace the departed cabinet members.
They included Greg Clark, an arch "remainer" opposed to Britain's divorce from the European Union, which Johnson had championed.
Johnson had been clinging on to power despite a wave of more than 50 government resignations, expressing defiance late Wednesday.
But Thursday's departure of education minister Michelle Donelan and a plea to quit from finance minister Nadhim Zahawi, only in their jobs for two days, appeared to tip the balance along with warnings of a new no-confidence vote by Tory MPs.
'No functioning government'
Defence minister Ben Wallace and Rishi Sunak, whose departure as finance minister on Tuesday sparked the exodus, were among the early frontrunners to succeed Johnson, according to a YouGov survey of Conservative party members.
Those members will decide the new leader once Tory MPs have whittled down the contenders to a final two.
Northern Ireland minister Brandon Lewis kicked off Thursday's frenzied events, becoming the fourth cabinet minister to resign and writing that Johnson was "past the point of no return".
Johnson late on Wednesday defiantly responded to calls from his loyalists and cabinet colleagues to step down by sacking minister Michael Gove, with a Downing Street source telling media that his former Brexit top ally was a "snake".
The Sun newspaper said Johnson had told colleagues they would have to "dip (their) hands in blood" to push him out of office, but Thursday's events forced his hand.
The shock resignations of Sunak and Health Secretary Sajid Javid late Tuesday set off a chain of others.
They quit after Johnson apologised for his February appointment of senior Conservative MP Chris Pincher as deputy chief whip.
Pincher was forced to step down following accusations he drunkenly groped two men.
Days of shifting explanations followed the resignation, before Downing Street finally conceded that Johnson had known about Pincher's behaviour as far back as 2019.
Tory critics said the Pincher affair had tipped many over the edge, angry at having to defend what they saw as more lies by Johnson over his appointment of what Starmer called a "sexual predator".
Johnson was confronted by members of his cabinet on Wednesday when he returned to Downing Street from a lengthy grilling by a parliamentary committee.
The delegation was said to include hardline interior minister Priti Patel.
Attorney General Suella Braverman told ITV that while she would not resign, "the balance has tipped now in favour of saying... it's time to go".
She became the first Tory to say she would stand in a leadership contest but is a rank outsider according to bookmakers.
A culture of scandal has dogged Johnson for months, including lockdown-breaking parties in Downing Street.
The prime minister, who received a police fine for the Covid lockdown-breaking "Partygate" affair, faces a parliamentary probe into whether he lied to MPs about the revelations.
He only narrowly survived a no-confidence vote among Conservative MPs a month ago, which ordinarily would mean he could not be challenged again for another year.
But the influential "1922 Committee" of non-ministerial Tory MPs is reportedly seeking to change the rules, with its executive committee planning to elect a fresh line-up of members next week.
In parliament on Wednesday, Johnson vowed to carry on, insisting the country needed "stable government".
But addressing MPs, Javid urged other ministers to resign.
"The problem starts at the top, and I believe that is not going to change," he told a hushed House of Commons.
Cries of "bye, Boris" echoed around the chamber at the end of his speech.