Scottish First Minister Nicola Sturgeon has announced she will be seeking "immediate discussions" with Brussels to protect Scotland's place in the European Union.
Ms Sturgeon revealed the plan after 62 per cent of Scots voted Remain in the EU referendum.
The SNP leader confirmed her government will begin to draw up the legislation that could see a fresh vote on Scottish independence take place within the next two years.
After a cabinet meeting at Bute House, Ms Sturgeon said: "We are determined to act decisively but in a way that builds unity across Scotland about the way forward.
"As I said yesterday, a second independence referendum is clearly an option that requires to be on the table and is very much on the table.
"To ensure that that option is a deliverable one within the required timetable, steps will be taken now to ensure that the necessary legislation is in place. Cabinet this morning formally agreed that work."
There is precendent for the idea of Scotland remaining in the EU while also staying as part of the United Kingdom.
Denmark is effectively a union of three states: the Danish mainland, the Faroe Islands and Greenland. While both of the latter regions have seats in Folketing, the Danish parliament, neither are in the EU.
The First Minister added: "Cabinet agreed that we will seek to enter into immediate discussions with the EU institutions and other EU member states to explore all possible options to protect Scotland's place in the EU.
"Over the next few days I will establish an advisory panel comprising a range of experts who can advise me and the Scottish Government on a number of important matters – legal, financial and diplomatic."
On Friday, Ms Sturgeon described the prospect of Scotland being withdrawn from the EU against its will as "democratically unacceptable".
Scottish Lib Dem leader Willie Rennie has offered his support to the First Minister 's aim of protecting Scotland's place in the EU.
He did, however, say he would not back her plans to push for another referendum on Scottish Independence.
Mr Rennie said: "If this was simply to be a charade devised to build up grievance in Scotland to aid the campaign for independence, it would not have received our support. I will not be a pawn in a new campaign for independence.
"However, I was given a guarantee from the First Minister that this was not the case and that she genuinely wanted this process to succeed.
"That is why we will lend our support to this process as it will need a cross-party effort to have the best chance of succeeding."
Opposition parties in Scotland have warned against rushing into a second independence referendum.
Scottish Conservative leader Ruth Davidson said the 1.6 million votes cast in favour of remaining in the EU "do not wipe away the two million votes that we cast less than two years ago" to remain in the UK.
"We do not address the challenges of leaving the European Union by leaving our own Union of nations, our biggest market and our closest friends," Ms Davidson said.
Scottish Labour leader Kezia Dugdale said fundamental questions asked during the independence campaign, such as those over currency, remained unanswered.
"Labour's manifesto ruled out a second referendum in the lifetime of this Parliament - we won't be changing our minds any time soon," she added.
Join our commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies