Angus Robertson, formerly the SNP leader in Westminster, lost his Moray seat to the Conservatives.
Photograph: John Linton/PA

The Scottish National party has endured a series of shock defeats including the loss of its deputy leader, Angus Robertson, and the former first minister Alex Salmond, after its political authority was heavily eroded by pro-UK parties.

Robertson’s defeat to the Conservatives in Moray, a seat with a very strong pro-Brexit and anti-independence vote, was the worst in a series of early losses for Nicola Sturgeon’s party.

The SNP went on to suffer a larger shock when the Tories defeated Salmond, a major figure in British politics.

Nicola Sturgeon, the first minister, admitted that these results were a huge blow to her and the party and indicated that she would have to reconsider her push for a second independence referendum.

“I’m not going to take any rash decisions. Clearly I will reflect on the result of the election. I will take time to do that,” she said.

When asked, before the result came through, about speculation that Salmond might have lost, she said this would be “bitterly disappointing”, adding that Salmond “is one of my closest friends and my mentor”.

Sturgeon insisted, however, that the SNP had still won the election in Scotland. Even as she faced the loss of 20 or more seats, she said it was the party’s second best Westminster election performance.

As a series of results slashed the party’s huge majorities, SNP seats fell to the Tories in rural and suburban constituencies including Ochil and South Perthshire, Angus and East Renfrewshire.

The SNP’s Pete Wishart held on to Perth and North Perthshire by the tightest of possible margins – 21 votes – as Scottish voters switched their backing for parties who opposed Sturgeon’s calls for a second independence vote.

Labour had a far better night than most polls predicted, winning shock victories in Gordon Brown’s former seat of Kirkcaldy and Cowdenbeath, Chryston, Coatbridge and Bellshill, and Rutherglen and Hamilton West.

The Liberal Democrats had several big victories, regaining seats lost to the SNP in 2015, including East Dunbartonshire, won by the former equalities minister Jo Swinson, and Caithness, Sutherland and Easter Ross. The Lib Dems were also heavy favourites to gain Edinburgh East.

Speaking before his result was declared, Salmond said: “It looks now certain that the SNP will win a majority of Scottish seats, more seats than all the other parties put together. By any democratic terms, that means that the SNP has won this election in Scotland.”

The BBC/ITV/Sky exit poll forecast that the SNP could lose 22 seats in this election, far more than commercial polls had been predicting. Those suggested the SNP would lose about 12 constituencies, although senior figures in the party were braced for the loss of 15 seats on a very difficult night.

There were several reassuring victories, but with a reduced share of the vote, with Mhairi Black holding Paisley and Renfrewshire South. The SNP also held Kilmarnock and Loudoun, Falkirk, East Kilbride, Strathaven and Lesmahagow, and Dunbartonshire West, with the SNP Treasury spokesman, Stewart Hosie, retaining Dundee West.

Black told BBC Scotland: “I’m glad to be re-elected to go back down and continue to batter into whoever is in government that austerity is not working, it’s not benefiting people’s lives whatsoever. The people it is benefiting, you could argue, are the one’s who need it least.”

The Conservatives won their top target seat of Berwickshire, Roxburgh and Selkirk in the Borders from the SNP with a majority of 11,060.

In those seats declared, there was significant evidence that the Tory vote was increasing and in some places beating Labour. That suggested Sturgeon’s risky gamble of accusing the Scottish Labour leader, Kezia Dugdale, of hiding her secret support for a second independence referendum last year from voters had paid off, by forcing unionist voters away from Labour.

After the most stunning election in recent history, Guardian reporters are writing from four key constituencies to make sense of the results. In Moray, Severin Carrell andphotographer MurdoMacLeod find palpable antipathy towards the SNP and little appetite for a second Scottish independence vote