SNP MP Tommy Sheppard has pulled out of the race to be the party's new Westminster leader.

The Edinburgh East MP had originally put himself forward to succeed Angus Robertson - who was one of the nationalists' high-profile casualties in the General Election - but later announced he would not be standing.

The decision means there are now three people in the running for the job - Ian Blackford, who represents Ross, Skye and Lochaber; Joanna Cherry, the MP for Edinburgh South West; and Drew Hendry, the MP for Inverness, Nairn, Badenoch and Strathspey.

Read more: SNP abandons £1m fundraising appeal for second referendum

In a statement, Mr Sheppard, who was elected to the House of Commons in 2015, said while there is "widespread support" for many of his ideas, he does not have "majority support for becoming leader" from his colleagues at Westminster.

He said the SNP must work to win back previous supporters who voted Labour in the election as a result of the "Corbyn surge".

With a second election possible in the coming months after the Conservatives lost their parliamentary majority, Mr Sheppard said: "We need to win these voters back and we might not have long to do it.

"In my view this means our priority should be to focus on our left flank and take the battle to Labour in Scotland.

"It is clear to me that whilst there seems widespread support for many of the ideas I am arguing, I do not have majority support for becoming leader.

Read more: Nicola Sturgeon and cabinet debate election fallout, but second independence referendum not discussed

"The message is more important than the messenger and so I have decided not to contest the election for group leader.

"I will instead seek assurances from the remaining candidates about the priorities for the months ahead and I will hope to persuade them of the need for a radical review of how we do things."

He said he is "extremely grateful" for the support he has received but "on this occasion it is not to be".

Mr Sheppard added: "It goes without saying that I will fully support whoever is successful in the contest."

The contest comes after Mr Robertson lost the Moray seat he had held since 2001 to Douglas Ross of the Scottish Conservatives.

Mr Robertson, who was also SNP depute leader, lost the seat by 18,478 votes to 22,637.

Read more: SNP abandons £1m fundraising appeal for second referendum

The SNP won 35 seats in last week's election, down 21 from 2015, with the Tories, Labour and the Liberal Democrats all making gains across Scotland.

First Minister Nicola Sturgeon has admitted the issue of another independence ballot was a factor in last Thursday's vote, and she said the party will reflect on its plan amid calls for it to be taken off the table.

She has turned her focus to the UK's Brexit approach as political leaders including Scottish Conservative leader Ruth Davidson call for more consensus.