First Minister Nicola Sturgeon welcomed Scotland's "unequivocal" vote to stay in Europe after all 32 local authorities delivered a vote for Remain.

But despite the vote, the country still faces having to exit the European Union (EU), after the Leave campaign edged ahead across the UK.

The result means Ms Sturgeon will now come under pressure to call a second independence referendum.

The SNP manifesto for May's Scottish Parliament election said there should be another ballot if there was a "significant and material" change in circumstances from the 2014 vote, such as Scotland being taken out of the EU against its will.

After all the results north of the border were declared, Ms Sturgeon said: "Scotland has delivered a strong, unequivocal vote to remain in the EU, and I welcome that endorsement of our European status.

"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."

She added: "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."

Former first minister Alex Salmond told the BBC: "Scotland looks like it is going to vote solidly Remain. If there was a Leave vote in England, dragging us out the EU, I'm quite certain Nicola Sturgeon would implement the SNP manifesto."

Almost two thirds (62%) of Scots who voted had backed staying part of the EU, with 38% opting for Brexit.

Holyrood External Affairs Secretary Fiona Hylsop warned that a decision by the UK to quit Europe would have "consequences".

She told the BBC: "Scotland clearly and decisively voted to remain part of the European Union, 62 to 38 with an increased turn out form the Scottish Parliament elections barely six weeks ago.

"That sends a strong message, it's quite clear we see a different type of politics in Scotland, a different approach to constitutional affairs."

"I think people will be looking very closely at this result and looking at the prospects for Scotland and what is in the best interests of Scotland going forward.

"We're quite clear, the Scottish Government will protect Scotland's interests whatever the circumstances and we intend to do that."

How the Scottish Government will do that "will depend on exactly what the result is", Ms Hyslop added.

"But we're very clear, the Scottish people have spoken. Their interests are about maintaining that membership, they are interested in maintaining our relations with Europe. We have to find the means with which we can do that."

While she said there is "some way to go in determining the mechanism of doing that", she said: "Decisions have consequences and if the United Kingdom has made a decision against the interests of the Scottish people that will have consequences."

As a victory for the Leave campaign appeared increasingly likely, the Scottish Greens launched an online petition calling on Holyrood to "examine and exhaust every option for continuing Scotland's close ties with Europe".

Scottish Green co-convener Patrick Harvie said: "It's devastating to see that the deceitful, manipulative and at times downright racist Brexit campaign has succeeded south of the border, and looks set to tear up the many benefits of EU membership and play fast and loose with our economic future.

"The Leave campaign claimed to be defending democracy, but they now propose to remove the rights of EU citizenship from Scotland regardless of the way people living here voted.

"Scotland must keep open every option for protecting ourselves from this threat. The Scottish Parliament and Government must be represented in the negotiations about what comes next. A cross-party plan of action should be sought, so we can defend our rights as EU citizens."