The SNP are predicted to lose 22 of their 56 seats in Scotland, according to the results of an exit poll.
The survey taken at polling stations across the UK also suggests the Conservatives will fall short of an overall majority at Westminster.
It predicts the Conservatives will finish with 314 MPs, with Labour on 266, the Lib Dems 14 and the SNP 34.
In Scotland, the Tories are predicted to win 15 seats, the Lib Dems five and Labour two.
Former SNP leader Alex Salmond and the party’s current leader at Westminster, Angus Robertson, among those said to be at risk – although many seats across the country are said to be too close to call.
A full seat-by-seat forecast based on the exit poll is available here.
However, election expert Prof Michael Keating expressed caution on the exit poll in Scotland.
He said across the UK the exit poll had been shown in the past to be very reliable with more than 30,000 people surveyed at 144 polling places.
But he added: “We don’t know how many were in Scotland. You need more than 10% in Scotland to get a reliable sample in Scotland.
“It may just be that the Scottish figures are less robust than the UK figures.”
He added that Scotland may have been fewer than 14 polling stations sampled, and therefore: “The confidence in translating votes into seats in Scotland might not be as strong as it would be across the UK.”
The first results in Scotland are due at about 01:30, with the final result of the election expected by lunchtime.
Responding to the exit poll, SNP MSP Aileen Campbell told BBC Radio Scotland: “That would still put us with the most seats across the country.”
But Conservative MSP Murdo Fraser told the broadcaster it would be an “astonishing decline” from the unprecedented success the SNP enjoyed two years ago.
BBC political editor Laura Kuenssberg said Prime Minister Theresa May took “a high risk strategy” by calling the election.
She added that Mrs May’s catchphrase had been “strong and stable leadership”, but she may well end the night diminished if the exit poll turns out to be correct.
Analysis by Nick Eardley, BBC Scotland political correspondent
Caveats, caveats. Attach them to everything over the next few hours.
But if the exit poll is true, it points to an astonishing picture.
If the SNP lose 22 seats, it’s likely to mean all the opposition parties at Holyrood far exceed their expectations.
But while the Scottish Tories will be delighted, the party UK-wide will be extremely worried. Falling short of a majority would mean Theresa May’s decision to go to the country has backfired spectacularly.
And was the political class wrong on Jeremy Corbyn? If if has increased his party’s tally by 34, it’s a remarkable turnaround for the man many of his colleagues fought hard to get rid of.
Scotland’s 4,710 polling places opened their doors at 07:00 BST on Thursday, with voting ending at 22:00.
First Minister Nicola Sturgeon said she was “feeling good” as she arrived to vote at Broomhouse Community Hall in the east end of Glasgow amid heavy rain.
The SNP leader gave a thumbs-up to about a dozen waiting photographers before going inside the hall with her husband Peter Murrell.
Scottish Labour leader Kezia Dugdale cast her ballot in Edinburgh, as did Scottish Conservative leader Ruth Davidson.
There were 3,988,420 people registered to vote in the general election in Scotland.
A Scottish Parliament by-election was held in the constituency of Ettrick, Roxburgh and Berwickshire.
Police had stepped up security around the election, with more than twice as many armed officers on duty as on a normal day following the terror attacks in Manchester and London, but there were no reports of any major incidents.
Sorry, your browser cannot display this content.
Find your constituency
Enter a postcode or seat name
Dont forget to “Like” us on Facebook
Need something to share, visit our sister site for the
‘News in the last 30 days”
in a clear concise package ….