The SNP’s former leader Alex Salmond has lost his Gordon seat to the Scottish Conservatives.
The Tories also defeated the SNP’s deputy leader Angus Robertson as they surged across Scotland.
The SNP are currently on 33 seats – a majority of the 59 Scottish constituencies.
The Conservatives have won 10 seats in Scotland so far, with Labour winning seven and the Liberal Democrats three,
The Tories have seen big increases in their vote across the country, with the SNP vote dropping sharply.
Mr Salmond had won a majority of 8,687 at the last election in 2015 – but the Conservatives saw their share of the vote increase by 29% as Colin Clark defeated the former first minister by 2,607 votes.
- Election 2017: Scottish results
- Election 2017: At-a-glance
- When will my constituency call its result?
- How to follow the election results
Earlier, Douglas Ross of the Tories overturned a majority of 9,065 to defeat Mr Robertson – who had been the SNP’s leader at Westminster – by 4,200 votes in Moray.
The SNP’s Tasmina Ahmed-Sheikh has also lost Ochil and South Perthshire to the Tories, who were a distant third in 2015.
The SNP’s John Nicolson lost Dunbartonshire East to Jo Swinson of the Liberal Democrat, who have also won Edinburgh West and Caithness, Sutherland and Easter Ross.
Speaking as she arrived at the Glasgow count, First Minister Nicola Sturgeon said that the SNP had won the election in Scotland, with the party achieving its second best performance ever in a Westminster election.
Asked about the impact of the lost SNP seats on her desire to hold a second independence referendum, Ms Sturgeon said: “Like most politicians I have not had any sleep and I am not going to take any rash decisions.
“Clearly I have to reflect on the result of the election and I will take time to do that. But it would be the wrong thing for me to do at this hour to take decisions before having had the opportunity to properly think about it.
“But properly think about it I will certainly do”.
Scottish Conservative leader Ruth Davidson hailed a “historic” night for her party, which she said was largely due to Ms Sturgeon’s attempts to “ram-raid through” a second independence referendum.
She said: “Indyref2 is dead. That’s what has happened tonight”.
There was better news for the SNP in Paisley and Renfrewshire South, where Mhairi Black kept her seat despite a big drop in her share of the vote.
Ms Black, the youngest MP at Westminster in the last parliament, had her majority over Labour cut from about 6,000 to about 2,500.
Elsewhere, Stewart Hosie held Dundee East – which had been the safest seat in Scotland – for the SNP, while Angus MacNeil held on in the Western Isles, despite his share of the vote falling by nearly 14%.
Pete Wishart also held on for the SNP in Perth and Perthshire North after finishing just 21 votes ahead of the Tory candidate, while Tommy Sheppard held Edinburgh East.
An exit poll had predicted that the SNP would lose 22 of the 56 seats it won in the last election in 2015.
The poll, which was taken at polling stations across the UK, also suggests the Conservatives will fall short of an overall majority at Westminster.
SNP politicians had cast doubt on the exit poll result when it was first published – with many insisting the party would not lose as many as 22 seats.
Sorry, your browser cannot display this content.
Find your constituency
Enter a postcode or seat name
More From this publisher : HERE