MSPs have handed Nicola Sturgeon a mandate to hold direct talks with European institutions and member states to protect Scotland's place in the EU.
Scotland's First Minister secured cross-party support at Holyrood for unilateral discussions in advance of meeting European Parliament President Martin Schulz in Brussels on Wednesday.
She sought the backing of the Scottish Parliament in an emergency debate following the UK's vote for Brexit despite 62% of Scots voting Remain.
The First Minister said she would return to Holyrood to propose a second independence referendum if the Scottish Government concludes it is ''the best or only way to protect Scotland's place in the EU''.
Labour, the Liberal Democrats and Greens backed her motion asking for a mandate for talks with the UK Government, other devolved administrations, EU institutions and member states, which passed by 92 votes to 0 with the Tories abstaining after their attempt to amend it failed.
Speaking in the Holyrood chamber, Ms Sturgeon said she was "determined that Scotland's voice will be heard" .
She has said the Scottish Government will draw up legislation for a second referendum on independence to allow for the option of it being held within the timeframe of UK negotiations on leaving the EU.
Ms Sturgeon told MSPs: ''I want to be clear to Parliament that whilst I believe that independence is the best option for Scotland, it is not my starting point in these discussions. My starting point is to protect our relationship with the EU.''
She continued: "However, let me clear about this - if the government does conclude that the best or only way to protect Scotland's place in the EU is through a referendum on independence we will return to Parliament with that judgment and it will then, at that time, be for Parliament to decide.
"I am emphatically not asking parliament to endorse that step today. A vote for this motion is not a vote for a referendum on independence."
Scottish Conservative leader Ruth Davidson called on the First Minister to negotiate on Scotland's behalf from within the UK.
She said: ''If the Scottish Government wants to explore Scotland's options within the United Kingdom, then we can support her in that.
''However, it is after this stage that we have concerns with the Scottish Government's approach in the days since the result.
''I cannot ignore the fact that, within hours of the vote becoming clear on Friday morning, the Scottish Government has pushed questions of independence front and centre.''
She added: ''I've heard the First Minister telling us that this motion today is nothing to do with independence.
''And yet, in the days since the result last week, it feels to many people across Scotland that the SNP is talking about nothing but independence, and has done so again today.''
Ms Davidson came under fire from Scottish Labour leader Kezia Dugdale, who accused the Tories of putting the future of the UK "in danger at every turn".
"It's high time they shouldered responsibility for that," she said.
Ms Dugdale added: "'All options for protecting Scotland's place in the single market must be explored, including a federalised United Kingdom which could see those nations of the UK who voted to remain retain their membership or achieve associated status."
She urged Ms Sturgeon to represent "Scots that voted both Yes and No, Scots that voted both remain and to leave".
"That faith would be betrayed if the First Minister tries to present our support for this motion as support for a second independence referendum.''
Patrick Harvie, co-convener of the pro-independence Scottish Greens, said: ''We will certainly support the actions that the First Minister has set out in preparing the ground for a further independence referendum, should it prove necessary and should it be the will of the people of Scotland.''
Scottish Liberal Democrat leader Willie Rennie said: ''I want to explore options - whether it is the bizarrely-named reverse Greenland; working with London, Northern Ireland, Gibraltar or some other arrangement.
''But we need to fully understand before we move ahead, and rushing head-long to independence will undermine those efforts."
Pro-Brexit MSPs spoke out on behalf of the 38% of voters in Scotland who backed leaving the EU.
Tory MSP Oliver Mundell said: '"Across Scotland over one million voters put their cross next to Leave, a larger number than put their cross next to Nicola Sturgeon for First Minister and just short of the total number who voted for the SNP in the constituency ballot.''
Accusing the SNP of "deliberate malice", he added: ''If they were serious about building consensus and negotiating in good faith, then they would have taken a second referendum off the table."
Labour's Elaine Smith, who also backed a Leave vote, said: ''We should all now respect the democratic mandate from the UK electorate which included the one million Scottish leave voters.''
Holyrood's Presiding Officer Ken Macintosh has said he may recall parliament during the summer to respond to the emerging Brexit situation.