Polls have closed and the counting has begun across Scotland to decide whether the UK remains part of the European Union.
Polling stations the length and breadth of Scotland shut their doors on the hour, 15 hours after opening at 7am on Thursday morning.
Counts are being held in all 32 Scottish local authority areas.
The vote is the second referendum for Scots in as many years.
In 2014 voters north of the border opted by 55% to 45% to remain part of the UK after a referendum on independence.
Scots voters are expected to have backed remaining part of the European Union, but the picture across the UK is less clear, prompting suggestions the current ballot could itself trigger a second vote on Scottish independence.
Earlier, SNP leader Nicola Sturgeon said she was hopeful of a large turnout in Scotland as she cast her vote.
Accompanied by husband and SNP chief executive Peter Murrell at Broomhouse Community Hall in Glasgow, Scotland's First Minister greeted voters at the polling station and posed for pictures.
She said: ''I'm feeling really optimistic and have just voted with my head and my heart.
''From what I could see on social media the weather is very patchy across the UK.
''I saw reports of people turning up to vote in pouring rain, but it's blue skies and sunshine in Glasgow - as always - so it's perfect voting weather.''
Ms Sturgeon has repeatedly warned that vote could be revisited if Scotland is ''dragged'' out of Europe against its wishes, if the UK as a whole opts for Brexit.
And she has said that Scotland could have a "big impact on the final vote", with Scots voters also potentially able to keep the UK in the European Union.
She has however already revealed that Scottish Government officials have been working on contingency plans for what could happen if the overall result is to leave the EU.
Ms Sturgeon and the leaders of the four other parties at Holyrood - Ruth Davidson of the Conservatives, Labour's Kezia Dugdale, Liberal Democrat Willie Rennie and Patrick Harvie from the Scottish Greens - have all been campaigning for a Remain victory.
But Ukip's Scottish leader David Coburn MEP has said he believes a majority of Scots could vote to quit the EU.
''Everyone is saying they are voting to Leave, and I find very few people who say they are voting Remain,'' he said while campaigning in Edinburgh this week.
''I think there is a majority for Leave in Scotland, or it is very close.''