With the dust settling on election results night, now is a good time to start looking at the numbers more closely.
First of all to the headline results, which were heavily influenced by the first-past-the-post electoral system used for Westminster elections.
The SNP won 35 seats, and were runners-up in the other 24. They won 59.3% of the seats with 36.9% of the vote.
The Tories won 13 seats, and were runners-up in nine. Their 28.6% of the vote yielded 22% of the seats.
Labour won a broadly similar 27.1% of the vote, but this resulted in only 11.8% of the seats. They won seven, and were runners-up in 25.
And the Lib Dems took four seats, coming second in one. Their 7.5% of the vote won them 6.7% of seats available.
Were the seats to have been divvied up by proportional representation, purely from the share of the vote, the SNP would have had 22, the Tories 17, Labour 16 and the Lib Dems four.
The numbers point to a far closer contest than in 2015, an election of razor-thin margins.
There were four constituencies decided by less than 100 votes in the 2017 election - the SNP clung on in all four.
To contrast in 2015, there were only three constituencies decided by less than 2,000 votes.
At the other end of the scale, there were two seats which ended with a majority of more than 20% on June 8. In 2015, there were 28.
Two votes separated the SNP and the Lib Dems in North East Fife - and it took three recounts to decide that.
In all, 39 MPs were elected with fewer votes than their party polled in their seat in 2015. The 35 SNP members are there, but there were also two Labour and two Lib Dem gains in seats where the party lost votes - their SNP opponents simply lost more.
In the table below are the most marginal seats in Scotland in 2015, and the safest seats in 2017. Look familiar?
Yes, the four safest seats today were all among the five most marginal prior to the election.
There was a swing in the opposite direction too. Seven seats have gone from having a majority of more than 20% to having a margin of 2% or less.
This election featured fewer candidates than any other recent poll - 266, down from 345 in 2015. How did this affect matters?
The Greens stood candidates in three constituencies. There were five seats where the SNP won by a slimmer margin than the number of Green votes there in 2015.
UKIP stood ten candidates. None of them got their deposits back - none managed more than 1.4% of the vote, let alone 5%.
Turnout was down almost across the board in Scotland, from 71.1% in 2015 to 66.4% in 2017. Turnout only increased in three constituencies - Glasgow Central, Glasgow North and Orkney and Shetland.
The biggest drop was in Dunbartonshire West, where turnout fell by 8.7 percentage points.
Glasgow North East registered the smallest turnout in the country, at 53%.