Nicola Sturgeon has said a second independence referendum is on the table as she prepares to do what it takes to keep Scotland in the European Union.

Ms Sturgeon said she thought a second independence referendum was 'highly likely' after the UK voted to leave the EU against Scotland's wishes.

The First Minister added that legislation is being prepared for a second independence to ensure it can be held before the UK leaves the EU in two years time.

Read more: David Cameron resigns as Prime Minister following Brexit

All of Scotland's local authorities voted to stay in the EU, however, 51.9 per cent of UK voters backed Leave.

Addressing the nation, Ms Sturgeon said: "As First Minister I have a duty to respond not just to the UK outcome of the referendum but to the democratic decision of Scotland.

Read more: Nicola Sturgeon's Brexit result statement in full

"As things stand Scotland faces the prospect of being taken out of the EU against our will. I regard that as unacceptable."

Ms Sturgeon said that she has spoken to the Bank of England and would be meeting with the European Commissioner following the shock result.

Read more: World Press highlights prospect of Scotland staying in EU as independent state

She also confirmed that the Scottish Cabinet will meet tomorrow to discuss their next move.

The First Minister said that she had made clear to David Cameron this morning that the Scottish Government must be involved in all future steps that the UK Goverment intends to take on Europe following the Brexit result.

She added: "The manifesto that the SNP were elected on last month said the Scottish Parliament should have the right to hold a referendum if there is a significant and material change in our circumstances.

Read more: North Sea warns industry is at a "critical" juncture as oil price tumbles following Brexit

"Scotland now faces that prospect. The option of a second referendum must be on the table and it is on the table.

"Discussions have to be had before decisions are taken but if parliament judges that a referendum is the only way to protect Scotland's place in Europe it must be able to do so in that time scale."

David Cameron resigned this morning after Remain lost the EU referendum.

Leave received 51.9 per cent of the vote, with Remain securing 48.1 per cent.

READ MORE: Barack Obama's Remain endorsement 'perhaps caused it to fail' according to Donald Trump

Voter turn-out for the referendum was over 67 per cent, almost matching the current UK record.

The Herald:

Scottish Liberal Democrat leader Willie Rennie said the Conservatives' "gamble" with the country's place in Europe is now hammering the economy and risking the future of the UK.

He said: "This referendum was a reckless gamble inflicted on the UK by a Conservative Party leader more focused on the divisions in his party than doing the right thing for our country and its economy.

"With the pound and the markets plummeting, the economy is already feeling the heat from this Brexit decision.

"Brexit is risking the future of the United Kingdom, too, with the SNP hungry for another referendum on independence.

"The Conservatives can no longer claim to be a party for a strong economy or the strongest defenders of the Union with the rest of the UK."