Orkney and Shetland was the last constituency to declare in Scotland.
Alistair Carmichael won the seat for the Liberal Democrats with 10,381. Robert Leslie for the SNP came in second and polled 7,874.
The other results were as follows:
Jennifer Fairbairn – Scottish Conservative and Unionist – 2,287
Coilla Anne Drake – Scottish Labour Party – 1,550.
Robert Watt Smith – The Brexit Party – 900.
David Stephen Barnard – Independent – 168.
The turnout was 67.93%, with 23,240 votes cast.
Across Scotland the SNP won 48 seats, Tories 6, Lib Dem 4 and Labour 1.
Boris Johnson increased his majority in his constituency and for the Tory Party. He will have a comfortable majority in the House of Commons. The UK will now be leaving the EU – all doubt of that happening is gone.
Reporter: Fiona Grahame