“And while the overall result remains to be declared, the vote here makes clear that the people of Scotland see their future as part of the European Union.

“Scotland has contributed significantly to the Remain vote across the UK. That reflects the positive campaign the SNP fought, which highlighted the gains and benefits of our EU membership, and people across Scotland have responded to that positive message.

“We await the final UK-wide result, but Scotland has spoken - and spoken decisively."

The SNP manifesto for the last Holyrood election suggested that a vote to leave the EU could act as a trigger for them to call a second independence referendum.

Speaking before the Leave vote was confirmed, Ms Sturgeon's predecessor as SNP leader, Alex Salmond, told the BBC: "If there was a Leave vote in England dragging us out of the EU, I'm quite certain Nicola Sturgeon would implement the SNP manifesto in which she received 47% of the vote last month."

The SNP’s Westminster leader, Angus Robertson, said the result could trigger a “constitutional crisis” that could lead to a second independence referendum.