The statement brings an end to an extraordinary standoff between Johnson and cabinet ministers, including his new chancellor, Nadhim Zahawi, who were urging him to quit amid anger over the Chris Pincher affair and other scandals.
Joined by his wife, Carrie, and a number of Tory supporters, Johnson said he was “sad to be giving up the best job in the world” and he blamed the Conservative parliamentary party for pushing him out of office.
“When the herd moves, it moves,” he said in a reference to the cabinet and MPs moving against him, while paying tribute to the “brilliant Darwinian system” that caused his downfall. “Them’s the breaks,” he added.
The prime minister said he had “appointed a cabinet to serve, as I will, until a new leader is in place”, pointing to a sense of duty and obligation to the public.
However, senior Conservative MPs are pushing back against the idea that Johnson should be allowed to stay in office for any longer and they want to see an interim leader in place such as Dominic Raab.
Support drained away from Johnson as more than 50 ministers and government aides resigned in a rolling walkout, while a slew of once supportive backbenchers declared no confidence in his leadership.
The revolt began on Tuesday evening with the resignations of Sajid Javid and Rishi Sunak as health secretary and chancellor respectively.
Johnson faced the prospect of a second vote of no confidence as soon as next week, with elections to the executive of the backbench 1922 Committee due to be held on Monday and likely to result in a change to the rules.