The Scottish Government is carrying out "appropriate planning" to prepare for the economic shock that a vote to leave the European Union (EU) would cause, the First Minister has said.

Nicola Sturgeon said while she hoped next week's referendum would not result in the UK quitting the EU, it is her "duty is to seek to protect Scotland's interests in all circumstances".

She confirmed to MSPs at Holyrood she is "ensuring that appropriate planning for all eventualities is being undertaken by the Scottish Government".

Read more: How Brexit could open up new constituency of support for independence among middle-class Scots

The SNP leader also repeated her warning that if the vote on June 23 results in Scotland being removed from the EU "against our democratically-expressed will", this could result in a second Scottish independence referendum.

Polls in Scotland have continued to show a majority of people want the UK to remain in Europe while more recent polls across the UK have put the Leave campaign in the lead.

The First Minister said that "if Scotland faces the prospect of being taken out of the European Union against our democratically-expressed will, then all options to protect our relationship with Europe and the European Union will require to be considered".

The Herald:

She spoke out after being questioned by Scottish Labour leader Kezia Dugdale on the impact the EU referendum could have on Scotland.

Ms Dugdale, who raised the issue at First Minister's Questions, warned that "sudden shocks" such as a vote for Brexit would hit the country's economy and would also "have a damaging impact on our ability to fund public services".

She asked Ms Sturgeon what contingency planning is being carried out in case there is a "shock to the UK economy".

Read more: Nicola Sturgeon brands Ukip Leave campaign's Breaking Point 'disgusting'

More than 300,000 jobs in Scotland are linked either directly or indirectly to the country's EU membership, the First Minister told MSPs.

She added: "More than 40% of Scotland's international exports go to countries within the single market, and of the more than 2,000 foreign-owned companies in Scotland, 40% are owned by firms that are based in other European countries.

"These are all positive reasons related to the jobs and livelihoods of thousands of people across Scotland for my conclusion that Scotland's continuing relationship with Europe is absolutely vital."

The Herald:

Ms Dugdale also stressed the referendum on Europe "is about securing hundreds of thousands of jobs, protecting the rights of workers and showing the world the type of country we want to be".

The Labour leader highlighted her support "for the principle of working together with the other nations of the world" to tackle global issues such as climate change, terrorism and the refugee crisis.

Ms Sturgeon agreed with that "very strongly", telling the chamber: "I believe passionately that Scotland should be an independent country and I very much hope in the near future we will be an independent country.

Read more: Former SNP leader 'exasperated' at party's 'confused' EU stance

"But I also believe very strongly that in the modern, interdependent world we live in, that independent countries must work together to tackle the issues that no country can deal with on its own, and that does include issues like climate change, the refugee crisis and tackling terrorism.

"Independent countries working together on these issues make all of us stronger and safer."

Pro-Brexit Conservative MSP Margaret Mitchell later raised a point of order challenging whether the exchanges had breached the Scottish Parliament's purdah rules during the referendum period, which prevent MSPs from using public resources to influence the outcome.

She said: "If they have been breached, what opportunity will there be to point out the unfettered free movement of people will deeply damage the economy and our public services, and to point out that as the fifth-largest economy in the world and a talented and innovative people the UK is more than capable of surviving outside the EU, and in fact it has been Nato and the UN which has preserved our security, not the EU?"

Presiding officer Ken Macintosh told MSPs the decision had been taken by Holyrood's business bureau, acting on legal advice, that parliamentary resources should not be used to promote one side or the other during the referendum.

He said: "I listened to both the questions and the answers very carefully. It is my judgement that they did not breach that agreement and they did not take a side on either side of the referendum issue.

"They did not use parliamentary resources to promote one side of the argument."

He was challenged by Labour MSP Neil Findlay, who pointed out parliamentary resources included the use of power in the chamber and the Official Report, the written record of what is said in the parliament.

Mr Findlay said: "I think we need absolute clarity on this because it is very important."

Mr Macintosh responded: "The use of the Official Report to report our proceedings is a use of parliamentary resources.

"In this particular case I did not judge that either the questions or the answers were an abuse of those resources."