Image copyright Reuters Image caption Angus Robertson lost his Moray seat in the UK general election last June

Angus Robertson has announced he is standing down as deputy leader of the SNP with immediate effect.

He lost his Moray constituency to Conservative Douglas Ross in the UK general election last June.

In a letter informing Nicola Sturgeon of his decision he said his mandate had been to partner her at Westminster but that it was now time to move on.

He said in a tweet he would "always be there to help Scotland reach its full potential".

Analysis by BBC Scotland Westminister correspondent Nick Eardley

We don't know for sure when the SNP's new deputy leader will be chosen - arrangements will be decided in "due course", the party says.

It comes at an interesting time.

The independence campaign was effectively parked after last year's election.

But it's an issue the SNP Scottish government will have to decide on sooner rather than later in the context of Brexit.

Clearly everyone who goes for the job will support independence, but how will the candidates approach the idea of a referendum in the next couple of years? And how will the membership react?

Some thought after the election that the party needs to be more radical to counter Jeremy Corbyn's Labour. Someone from the party's left might fancy a stab at the deputy leader job.

Mr Robertson was a respected figure at Westminster. In his resignation letter, he says he no longer felt able to fulfil his mandate as Nicola Sturgeon's eyes and ears in the Commons.

The party may well want to keep its top two split between the two parliaments.

It's also likely some at Holyrood will mull over a bid. Last time an MEP and a councillor threw their hats in the ring too.

There's plenty to watch out for in the next few months.

Tweeting a response to Mr Robertson, the first minister Ms Sturgeon described him as an "outstanding" deputy leader.

She added: "You should be very proud of your enormous contribution to our party's success. I wish you well and hope to see you back in frontline politics in the future."

In his letter Mr Robertson wrote: "Since the 2017 general election I have been focussed on supporting campaign best practice for local SNP branches, constituency associations, elected members and the party nationally.

"As discussed recently, I believe I am no longer able to fully discharge my mandate, which was to partner you as Westminster SNP leader and as a parliamentarian representing a rural constituency.

"While it would be my greatest privilege to continue as deputy leader, I know you understand that I have to focus now on pursuing new career opportunities."

He added he was "tremendously honoured" to have held the role, and would now work to support public policy development in Scotland as an advisory board member of the Scottish Policy Foundation.

Image copyright PA Image caption Angus Robertson with Nicola Sturgeon and other SNP MPs after the announcement of last year's snap general election

Ms Sturgeon told the former MP he had "always been a source of wise counsel" to her, noting that when he was first elected to Westminster the SNP had just five MPs.

The party went on to win 56 of the 59 seats up for grabs in Scotland in the 2015 general election, although it lost 21 of those constituencies some two years later.

Ms Sturgeon said: "Our political and electoral success over the last decade has been nothing short of extraordinary - and the party owes you an enormous debt of gratitude for the personal role you have played in bringing about that success.

"That includes your part in the 2014 referendum which brought the country closer to independence than ever before."

After losing his seat in the general election, Mr Robertson was replaced as SNP Westminster leader by Ian Blackford.

Mr Robertson had won widespread praise for his performance at PMQs, with many political opponents commending his questioning of the prime minister.

When he was elected to the deputy leader role in October 2016 he succeed Stewart Hosie, who quit the position following claims about his personal life.

The contest then was decided through a single transferable vote system that saw members rank the candidates in order of preference.

All five of the party's last leaders - Nicola Sturgeon, Alex Salmond, John Swinney, Gordon Wilson and Billy Wolfe - had previously served as the party's deputy leader.