Boris Johnson has said it is “painful not to be able to see through so many projects and ideas” as he announced his resignation as Tory party leader.
The PM was met with cheers from family and staff as he made his resignation speech outside No 10.
He said he had tried to persuade colleagues it would be “eccentric” to change leader and blamed the “herd instinct” in Westminster for his exit.
He said a timetable for a leadership contest would be announced next week.
The winner of that contest will become the next UK prime minister.
Mr Johnson faced a mass revolt by ministers over his leadership, sparked by the dramatic resignation of Chancellor Rishi Sunak and Health Secretary Sajid Javid on Tuesday evening.
He resisted calls to quit – including from newly-appointed Chancellor Nadhim Zahawi – for 48 hours until it became clear that he had lost the confidence of his party and could not continue.
Speaking outside Downing Street, he said he had secured an “incredible mandate” in the 2019 general election, winning “the biggest Conservative majority since 1987”.
“The reason I have fought so hard in the last few days to continue to deliver that mandate in person, was not just because I wanted to do so, because I felt it was my job, my duty, my obligation to you to do what we promised in 2019.”
“I regret not to have been successful in those arguments,” he said but acknowledged that the will of his party was “clear”.
“In politics, no one is remotely indispensable,” he said adding: “I want you to know how sad I am to be giving up the best job in the world, but them’s the breaks.”
He said he was proud of his achievements in office citing taking the UK out of the EU, the government’s response to Covid and rolling out the vaccine programme.
He also said he had led “the West in standing up to Putin’s aggression in Ukraine”.
Addressing the Ukrainian people he said: “We in the UK will continue to back your fight for freedom for as long as it takes.”
President Volodymyr Zelensky praised Mr Johnson for “realising the threat of RF[Russian Federation] monster and always being at the forefront of supporting [Ukraine].”
Mr Johnson thanked his wife Carrie and their children as well as the staff of Downing Street and “you, the British people, for the immense privilege you have given me”.
“I know even if things can sometimes seem dark now our future together is golden.”
He promised that he and his cabinet would to serve the country’s interest until a new leader is chosen.
Mr Johnson came to power in July 2019 and six months later won a massive majority in a general election.
However, he has been dogged by controversy in recent months, including a fine for breaking his own lockdown laws and his handling of sexual misconduct allegations against former Deputy Chief Whip Chris Pincher.