NICOLA Sturgeon has ordered officials to draw up contingency plans for a second independence referendum if Scots vote to stay in the EU but the UK as whole opts to leave.

The First Minister told MSPs "all options to protect our relationship with Europe and the European Union will require to be considered" if Scotland faced the prospect of leaving the EU against the wishes of most voters.

Her spokesman later made it clear she was referring to plans for a second referendum rather than legal or parliamentary mechanisms to block or delay Brexit.

Ms Sturgeon has talked down the possibility of a second independence referendum in recent days.

But, speaking during First Minister's Questions, she said plans were being made to counter the "economic shock" of leaving the EU.

She told MSPs "Let me be very clear: as First Minister, my duty is to seek to protect Scotland’s interests in all circumstances and, therefore, I am ensuring that appropriate planning for all eventualities is being undertaken by the Scottish Government.

"Let me also say—I have said this many times before—that, if Scotland faces the prospect of being taken out of the European Union against our democratically expressed will, all options to protect our relationship with Europe and the European Union will require to be considered."

In its election manifesto, the SNP said Holyrood should have the right to stage a second independence referendum if there was a "material change in circumstances" compared with 2014.

The only concrete example it gave was the possibility of Scotland leaving the EU against the wishes of most voters.

Ms Sturgeon has also indicated she would only call a second independence referendum if polls showed a clear majority supported leaving the UK over a sustained period.

Although she has appeared lukewarm about a swift re-run of the 2014 poll, former First Minister has said Scots should vote again on independence within the two year negotiating period before the UK formally left the EU.

If Scotland voted Yes, it could then negotiate membership of the EU without have to leave the bloc.

However, experts have identified a number of ways in which the Scottish Government could try to block or challenge Scotland's removal from the EU without a vote to leave the UK.

MSPs could refuse to repeal or revise EU legislation embedded in Scots law, or might challenge the loss of rights by citizens as part of Brexit.

Asked to detail the options available to the Scottish Government, Ms Sturgeon's chief political spokesman played down the use of such legal or parliamentary mechanisms.

He said contingency plans were "more in the political than the legal sphere".

Asked if he was referring to a second independence referendum, he said: "I would simply refer to you what the manifesto said at the recent election with regard to that.

"It is a very, very specific reference to exactly this scenario which was spelled out in a black and white.

"That proviso is in the manifesto. That would influence thinking."

Ms Sturgeon, replying to questions from Scottish Labour leader Kezia Dugdale, said 300,000 Scottish jobs were linked to the EU and the relationship was "absolutely vital" for the economy.

The exchanges came despite 'purdah' rules prohibiting Holyrood from debating the referendum in the final two weeks before the vote.

Tory MSP Margaret Mitchell, who supports the Leave campaign, objected to the issue being raised during First Minister's Questions, but her complaint was dismissed by Presiding Officer Ken Macintosh.

Scottish Vote Leave director Tom Harris claimed Ms Sturgeon's contingency plans were a sign of panic.

"There is no doubt they are panicking like mad.

"The First Minister has been encouraging Scots to vote in such heavy numbers as to keep England inside the EU against its will.

"She said that would be acceptable.

"So she cannot now complain that there is anything wrong at all in Scotland being taken out of the EU by English votes.

"She has already approved that in principle," he said.

We are talking more in the political than the legal sphere.

Q. We are more talking about the prospect of another independence referendum as the FM has discussed in the past?

I would simply refer to you what the manifesto said at the recent election with regard to that.

It is a very, very specific reference to exactly this scenario which was spelled out in a black and white.

That proviso is in the manifesto. That would influence thinking.