Nicola Sturgeon has challenged Boris Johnson to give Scotland the powers to hold a second independence referendum after the Scottish National party won a landslide in the general election.

The first minister said she had won “a renewed, refreshed and strengthened mandate” to call for a fresh independence vote after winning 47 of Scotland’s 59 Westminster seats, 11 more than in 2017.

In the most dramatic result, the SNP unseated Jo Swinson, the Liberal Democrat leader, in East Dunbartonshire by 149 votes, leaving the party leaderless.

Sturgeon said on Friday the Conservatives had focused their campaign in Scotland on opposing a second referendum but had been roundly defeated, hit by a series of losses at the hands of the SNP in seats including Stirling, Angus and Gordon.

“I don’t pretend that every single person who voted SNP yesterday will necessarily support independence, but there has been a strong endorsement in this election of Scotland having a choice over our future; of not having to put up with a Conservative government we didn’t vote for and not having to accept life as a nation outside the EU,” she said.

SNP strategists said the significance of its victory, which has echoes of its remarkable landslide in 2015 when it won 56 seats, was given greater weight by the contrast with the election result in England where the Tories won a significant overall majority.

By comparison, the Tories in Scotland had a very difficult election, holding only six of the 13 seats they won in 2017. Labour was humiliated, losing six of the seven seats they held to the SNP, belying the party’s confident claims in the final week of the campaign it would hold those seats and win several more.

The only surviving Labour MP in Scotland was again Ian Murray, who held Edinburgh South with a significant 11,095 majority. Murray, an arch-critic of Jeremy Corbyn’s, was Labour’s only Scottish MP after the SNP landslide in 2015.

Officially, the SNP won an additional seat in Kirkcaldy and Cowdenbeath but the victorious candidate there, Neale Hanvey, was suspended by the party in late November for two antisemitic social media posts. He defeated Lesley Laird, Labour’s shadow Scottish secretary, but until the party’s conduct committee rules on his future in the SNP, he will sit as an independent at Westminster.

Sturgeon has already promised to formally ask the UK government for the powers to stage a second referendum before Christmas, but chose not to focus on that option as she enjoyed her party’s election victories.

She sought instead to put the onus on Johnson to respond, knowing he is certain to reject that request out of hand, pushing the UK to the edge of a constitutional crisis. “I have just won an election on the strength of the argument that it’s Scotland’s right to choose,” she said. “It’s up to the Tories to decide what their plan B is when my plan A has just been given a ringing endorsement.”

Many of the Scottish results suggested significant amounts of tactical voting took place amid very high turnouts in many seats. The SNP lost in places it had expected to win.

Play Video 0:50 Jo Swinson warns against 'wave of nationalism' as she loses seat to SNP – video

The most notable defeat for the SNP came at the hands of the Lib Dems in North East Fife, the UK’s most marginal constituency. Once held by Sir Menzies Campbell, the former UK Lib Dem leader, significant numbers of Tories swung behind the Lib Dems in an anti-independence protest vote.

Even so, the SNP enjoyed an unexpectedly large number of gains after Sturgeon built a coalition of pro-EU and anti-Tory voters in other parts of Scotland.

Senior Tories acknowledged Johnson was an unpopular leader for many Scottish Conservative voters, while moderate Labour and Lib Dem voters in Tory-held were swayed by Sturgeon’s switch late on in the campaign to focus solely on defeating Boris Johnson and preventing Brexit.

Murray said the scale of Labour’s defeat in Scotland, a country the party once dominated, was evidence of how little respect Labour voters had for Corbyn, who now had to consider resigning.

“The buck always stops with the leadership. I knocked on 11,000 doors [in Edinburgh South] and he has been the problem, and we either acknowledge that and reflect on that and do something about it, or we don’t deserve to be in power.”

Play Video 3:55 UK election 2019: how the Tory triumph unfolded – video report

Sturgeon’s strategists were initially sceptical about the Ipsos Mori exit poll which forecast the SNP would win 55 seats because Scotland has a large number of marginal seats. However, as results came in showing significant SNP gains, the BBC’s revised forecasts suggested the SNP would win 52 seats.

Richard Leonard, the Scottish Labour leader, rejected suggestions he should resign and denied that Corbyn was to blame for the party’s defeats.

Corbyn had been subjected to a campaign of vilification by the media “and some of that did seem to seep through to people”, Leonard said. “The difficulty we have was that the campaign was dominated by the constitutional questions around Brexit and the Scottish constitutional question.”