Media playback is unsupported on your device Media caption Boris Johnson out of Conservative leadership contest

Ex-London mayor Boris Johnson has ruled himself out of the race to be the next Conservative leader and prime minister.

In a speech in London - billed as his campaign launch - Mr Johnson said he did not believe he could provide the leadership or unity needed.

It comes after Justice Secretary and fellow Brexit campaigner Michael Gove's surprise announcement on Thursday morning that he would run for leader.

Home Secretary Theresa May is among the candidates. Nominations closed at noon.

Media playback is unsupported on your device Media caption Theresa May: 'You can judge me by my record'

Also in the running are Energy minister Andrea Leadsom and former Defence Secretary Liam Fox - who campaigned to leave the EU - and Work and Pensions Secretary Stephen Crabb, who backed Remain.

The contest was sparked after David Cameron announced he would resign following the EU referendum result, which saw the UK vote by 52% to 48% to leave the EU.

Mr Johnson's unexpected - and dramatic - announcement that he would not stand for Tory leader or prime minister, positions he is long thought to have harboured ambitions for, has dramatically altered the race.

Analysis

Image copyright AFP/Getty Images

By Ben Wright, BBC political correspondent

"Shakespearian" is the word being mumbled by dazed politicians and pundits at Westminster.

The ambitions, rivalries and duplicitous double-dealing unleashed before the Tory leadership contest even got underway has left onlookers groping for fictional comparisons.

It's Richard III meets Scarface, with a bit of Godfather thrown in.

Remember this: David Cameron, Boris Johnson, Michael Gove and George Osborne grew up together - personally and politically. Their families were close. But the EU referendum ripped through old loyalties.

First Michael Gove backed the Leave campaign, knowing the damage it could do to Cameron and Osborne. The chancellor and Gove kept their friendship intact despite the strain of the campaign.

But it was Boris Johnson's decision to lead the Leave campaign and put his own ambitions to be prime minister ahead of loyalty to David Cameron that severed his relationship with the now departing PM, destroyed by Leave's victory.

Boris Johnson believed the crown would be his and naively believed Michael Gove's promises of support. But now Mr Gove, despite polite protestations he never coveted the top job, has ruthlessly dispatched his friend.

What has been going on behind the scenes? The truth will only emerge in memoirs.

But my sense is Mr Gove and his team of advisers clearly did not believe Boris Johnson had the spine to fully divorce Britain from the EU. Nor did a number of Tory Mps trust Mr Johnson to deliver the promises he was making in terms of personnel and jobs.

When Mr Gove made his move, hardened Brexit believers instantly went with him, sinking Boris Johnson.

The irony of course is that Boris Johnson, who did so much to take Britain out of the EU, has seen his own ambitions crushed in the aftermath.

It could be that the big winner from this vicious Tory drama is the woman in charge of law and order - Theresa May.

Addressing reporters in a new conference just moments before the deadline for nominations passed, Mr Johnson said the next Conservative leader would have to unify his party and ensure that Britain stood tall in the world.

"Having consulted colleagues and in view of the circumstances in Parliament, I have concluded that person cannot be me," he said.

BBC assistant political editor Norman Smith said it was an "astonishing turn of events".

Who's in the running?

Home Secretary Theresa May: The 59-year-old is the bookies' favourite to win the contest. She's held the Home Office brief - often something of a poisoned chalice - since 2010, and is a former Tory party chairman. She says she can offer the "strong leadership" and unity the UK needs, and promised a "positive vision" for the country's future. She backed staying in the EU.

Justice Secretary Michael Gove: The 48-year-old former newspaper columnist was a key figure in the party's modernisation that led to its return to power in 2010. He was a reforming, if controversial, education secretary between 2010 and 2014, and now holds the Ministry of Justice brief. He was a leading player in the Brexit campaign - which put a strain on his close friendship with David Cameron. He has pitched himself as the candidate that can provide "unity and change."

Work and Pensions Secretary Stephen Crabb: The 43-year-old was promoted to the cabinet in 2014 as Welsh secretary, and boosted his profile earlier this year when he took over as work and pensions secretary. A rising star of the Tory party he has promised to unite the party and country following the referendum result and provide stability. Raised on a council estate by a single mother, he has a back story to which many Tory MPs are attracted. Backed Remain.

Energy minister Andrea Leadsom: The 53-year-old former banker and fund manager was one of the stars of the Leave campaign. A former district councillor, she became MP for South Northamptonshire in 2010 and - after serving as a junior Treasury minister and as a member of the Treasury select committee - she was made a junior minister in the energy and climate change department in May last year.

Former cabinet minister Liam Fox: It's second time around for the 54-year-old ex-defence secretary and GP, who came a close third in the 2005 leadership contest. His cabinet career was cut short in 2011 when he resigned following a lobbying row. A Brexit campaigner, and on the right of the party, he has said whoever becomes PM must accept "the instruction" of the British people and not "try to backslide" over EU membership.

Mr Gove - who has pitched himself as a candidate that can offer "unity and change" and deliver the Brexit result- had been expected to back Mr Johnson for the leadership.

But he said he had concluded that "Boris cannot provide the leadership or build the team for the task ahead".

Justice minister and Leave campaigner Dominic Raab, who switched sides from supporting Mr Johnson to Mr Gove, said the former London mayor's "cavalier" attitude had scuppered the plan.