European election: UKIP on course for Scots MEP seat
UKIP is on course to win its first Scottish seat in the European election, on a night which saw the SNP take the biggest share of the vote.
Scotland's party of power is expected to win two of the six MEP seats, with two for Labour and one for the Conservatives.
The Liberal Democrats, who came sixth, will lose their previously held European Parliament seat.
All of the country's 32 council have now declared their results.
The final result came from the Western Isles, which does not count votes on a Sunday, shortly before noon. The 31 other local authorities had all declared overnight.
UKIP lead candidate David Coburn, whose party won 10% of the vote in Scotland, said the result showed his party had appeal beyond England.
Attacking the Scottish government ahead of the 18 September Scottish independence referendum, Mr Coburn said his party would "stand up to Salmond and his nasty little dictatorship".
"This result says people in Scotland are as worried about the same things as everyone else in the rest of the United Kingdom," he said.
"We all have the same problems that need to be resolved and, quite frankly, Mr Salmond seems to think that Scotland is so different from everywhere else - well, it's not."
However, Scottish First Minister and SNP leader Alex Salmond said the Euro poll was a "remarkable result" for his party and a "real vote of confidence" in the nationalists, after seven years in government.
He added: "UKIP's performance has shown the real and increasing threat to Scotland's place in the EU that comes from being part of the Westminster system.
"But in Scotland, UKIP have come fourth with only around a third of the vote they got in the rest of the UK, where they won the election, and only around 3% of Scotland's electorate backing them - despite the wall-to-wall media coverage of UKIP that has been beamed into Scotland."
Mr Salmond said only a "Yes" vote in the independence referendum would protect Scotland's place in the EU.
The SNP won 386,193 votes on the night - almost 29% - with Labour coming second, on 346,377 votes (25.9%).
Deputy Scottish Labour leader Anas Sarwar said his party's "energetic" campaign had ensured it had retained two MEPs and an increased share of the vote.
He added: "Right across Europe, nationalist parties are taking advantage of the economic downturn and with Alex Salmond fighting (UKIP leader) Nigel Farage for the last seat in this election, it is clear this is no different in Scotland.
"It is time for the moderate majority of Scots to assert themselves, as we believe they will on September 18 in standing up to these dual forces."
In third place was the Conservatives, with 230,569 votes (17.2%), followed by UKIP on 139,687 (10.4%).
A Scottish Tory spokeswoman said: "To increase our share of the vote in a six-party contest for the first time is further proof that the party is moving in the right direction and standing up for the issues that matter to people, such as giving them a say on Europe."
The Scottish Greens hailed their "best ever result", after winning 107,805 votes (8%), while the Liberal Democrats got a total of 95,076 votes (7%).
Green co-leader Patrick Harvie, said: "We have strengthened our position as the torch-bearer for radical ideas in Scottish politics, and are in the process of replacing the Liberal Democrats as Scotland's fourth major party.
Scottish Lib Dem leader Willie Rennie, added: "We continue to pay the price for being in coalition and for the decisions we have taken in government. I get that.
"In this election, we put forward a positive case which was unashamedly pro European. Despite our defeat I am proud of that."
The European Parliament's powers have expanded since the last election, and the 751 MEPs now negotiate legislation with national government ministers, before parliament votes on the laws.
They also have a say on budget areas, including agriculture and regional aid.
European Parliament seats are allocated in proportion to each country's population.
Britain is one of eight countries to use a "closed list" system where people vote for a party, rather than an individual, with seats allocated within each European constituency using the D'hondt system, a form of proportional representation.
The new intake of MEPs will be representing 500 million citizens in 28 states.