Scotland has voted emphatically to stay in the European Union (EU) - but may be heading for the exit door if the UK as a whole votes to leave.

With the Leave campaign narrowly ahead across the UK, Ukip leader Nigel Farage declared: "I now dare to dream that the dawn is coming up on an independent United Kingdom."

By 4.15am 30 of Scotland's 32 local authorities had voted in favour of Remain, with just two areas left to declare.

In Edinburgh almost three quarters of voters backed staying in Europe, with a similar result in East Renfrewshire

In Scotland's largest city Glasgow, voters backed Remain by a margin of two to one, with 66.59% in favour of staying in Europe, compared to 33.41% who favoured Brexit.

But the turnout there was 56.2%, lower than many other parts of the UK.

Overall just over two thirds (67.2%) of eligible voters in Scotland took part in the referendum, with a total of 2,681,179 votes cast north of the border.

Former first minister Alex Salmond said the result of the referendum across the UK "is going to go right down to the wire".

And he again warned that Scots could hold a second independence referendum if the country is "dragged" out of the European Union.

Mr Salmond, who stood down as SNP leader after losing the 2014 independence referendum, told the BBC that there had been "a very strong turn out in Scotland and it's a very strong vote so far for Remain".

He said: "Scotland looks like it is gong 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."

The party's manifesto ahead of May's Scottish Parliament election said Holyrood should have the right to hold a second independence vote if there is a "significant and material" change in circumstances from 2014 such as Scotland being taken out of the EU against its will.

Meanwhile SNP's Westminster leader Angus Robertson dismissed suggestions that the party had not done enough to encourage people to the polls.

Defending the SNP against Labour criticisms, he told Sky News: "Turnout has historically always been lower in Glasgow relative to the rest of the country."

He added: "66% of the result (for Remain) is a pretty strong result and frankly to be lectured by the Labour Party which lost almost every single seat in Scotland, I don't think they're really qualified.

"It did come from a source in London who obviously knows nothing about the campaign on the ground here."

He said "We worked very hard. Remain is winning in Scotland."

Scottish First Minister Ms Sturgeon also hit back at claims that her party had failed to do enough in European campaign.

The SNP leader tweeted: "Labour has lost it. Scotland voting strongly Remain, Labour areas in Eng/Wales going Leave - but still all SNP fault."