The Scottish Government will draw up legislation to allow a second independence referendum to be held, First Minister Nicola Sturgeon has confirmed.
While the UK as a whole voted to leave the European Union, Scots overwhelmingly opted to remain, with Ms Sturgeon declaring the result meant there had been a "significant and material change in the circumstances in which Scotland voted against independence" in 2014.
She said: "As things stand, Scotland faces the prospect of being taken out of the EU against our will. I regard that as democratically unacceptable."
The First Minister said it is now "highly likely" that there will another vote on Scotland's place in the UK in the next two years.
Speaking at her official residence, Bute House in Edinburgh, she said: "I intend to take all possible steps and explore all possible options to give effect to how people in Scotland voted - in other words to secure our continuing place in the EU, and in the single market in particular."
The SNP manifesto for May's Holyrood elections said the Scottish Parliament "should have the right to hold another referendum if there is a significant and material change in the circumstances that prevailed in 2014, such as Scotland being taken out of the EU against our will".
Ms Sturgeon said: "It is, therefore, a statement of the obvious that a second referendum must be on the table, and it is on the table."
All 32 local authority areas north of the border returned a majority for Remain in the EU referendum, with the country voting by 62% to 38% in favour of Remain.
Ms Sturgeon said: "Unfortunately, of course, yesterday's result in Scotland was not echoed across the whole of the United Kingdom. The UK-wide vote to leave the EU is one that I deeply regret.
"The vote across England and Wales was a rejection of the EU and it was a sign of divergence between Scotland and large parts of the rest of the UK and how we see our place in the rest of the world."
The Scottish Government's resilience committee, which meets in times of emergency, is due to meet this afternoon, Ms Sturgeon said.
Ministers will seek "direct discussions" with EU institutions and member states, with Ms Sturgeon saying she would "make clear that Scotland has voted to stay in the EU and I intend to discuss all options for doing so".
The Scottish Cabinet will meet on Saturday while the First Minister will make a statement to MSPs at Holyrood on Tuesday.
Ms Sturgeon stressed, however, there are "many discussions to be had before final decisions can be taken" and said: "It would not be right to rush to judgements ahead to discussions on how Scotland's result will be responded to by the EU."
She went on to state that when the UK Government triggers the Article 50 process to withdraw from Europe, "the UK will be on a two-year path to the EU exit door".
The SNP leader added: "If Parliament judges that a second referendum is the best or only way to protect our place in Europe, it must have the option to hold one within that timescale.
"That means we must act now to protect that position.
"I can therefore confirm today in order to protect that position we will begin to prepare the legislation that will be required to enable a new independence referendum to take place if and when Parliament so decides."
After having campaigned for a Remain vote, Ms Sturgeon said: "This is not a situation that I wanted Scotland or the UK to be in today.
"The issues we face are complex. There are many people who voted against independence in 2014 who are today reassessing their decision, indeed a very large number of them have contacted me already.
"My priority in the days, weeks and months ahead will be to act at all times in the best interests of Scotland and in a way that unites not divides us."
She insisted: "I am proud of Scotland and how we voted yesterday.
"We proved we are a modern, outward-looking, open and inclusive country, and we said clearly that we do not want to leave the Euroepan Union.
"I am determined that we will do what it takes to make sure that these aspirations are realised."
Answering questions from journalists, Ms Sturgeon said a second vote on independence "is now highly likely" but added: "I also think it's important that we take time to consider all steps and to have the discussions, not least to assess the response of the European Union to the vote that Scotland expressed yesterday.
"I am absolutely determined in my responsibility to give effect to how Scotland voted yesterday and it's important that I take all steps to make sure that we explore all options to do exactly that."
Ms Sturgeon was also questioned on whether she was confident that Scots would back independence amidst the potential turmoil of a Brexit vote.
She responded: "It is exactly because of the uncertainty and the potential turmoil that we face that I think it is in my responsibility to seek to bring Scotland together, to lead Scotland forward into a position that allows us to continue with the stability and the certainty that membership of the EU gives us.
"I'm not saying that these issues are straightforward but I do think that is the responsibility, and indeed the opportunity, that now lies before us."
Pressed on what level of public support she would like to see before another referendum on independence is held, she replied: "My guiding principle in every decision I take over these next days, weeks and months will be what I judge to be in the best interests not of the SNP or as me as First Minister, but what I judge to be in the best interests of Scotland. That's the responsibility I have and that's how I will guide every decision I will take."