AFTER Britain voted to leave the European Union, Nicola Sturgeon spied an opportunity to use that referendum to rerun another. The leader of the Scottish National Party (SNP) took the Scots’ 62%-38% vote to stay in the bloc as a reason to call for a second referendum on independence, which voters had rejected by 55% to 45% in 2014. As it turned out, however, many Scots have had it with the ballot box. At the general election on June 8th— in Scotland, the fourth major vote in as many years—they thwarted Mrs Sturgeon’s ambitions.

Her party remains the biggest one north of the border. But it fell precipitously from the highs it reached at the general election in 2015, when lifelong Labour voters who had voted for independence migrated in huge numbers to the SNP. It has won 35 of Scotland’s seats, down from 56, and 37% of the vote, versus nearly 50% last time around. Mrs Sturgeon, who is also Scotland’s first minister, remains powerful—but she is damaged. For the first time in more than a decade the SNP is losing momentum.

By contrast Ruth Davidson, the leader of the Scottish Conservatives, is buoyant. She won 13 seats and nearly 29% of the vote. Her party has redrawn the electoral map, sweeping areas outside of Scotland’s populous central belt. The east coast, Ayrshire in the south west, and the borders, now have patches of blue. That is a huge turnaround from 2015, when her party won one seat and 15%. Without the effervescence of the smiley, mouthy, sharp-witted 38-year-old, the Scottish Tories would not have done as well; without those seats, Theresa May would have been in even deeper trouble at Westminster.

The Labour party also picked up more seats than it hoped for. As well as defending its one existing seat in Edinburgh South, the party won six in its former heartland, in places such as Hamilton West and Kirkcaldy. The Liberal Democrats, meanwhile, took an additional two seats.

As ever in Scotland these days, the main cause of the political shifts is independence. If 2015 was the election in which supporters of secession flocked to the SNP, in 2017 a more diluted version of that trend happened among pro-union voters. Many moved towards the party best placed to defeat the SNP; and mainly that was the Conservatives. The Tories also benefited because they have in Ms Davidson a leader who, unlike Mrs May, comes across as a human being.

Although in Edinburgh South, Labour won because of pro-union voters, elsewhere the cause was subtly different. Since the SNP’s vote share was seven percentage points below support for independence, that suggests quite a lot of Yes voters opted for Labour this time around. That would mark a return to an earlier pattern of voting in Scotland, whereby people preferred the SNP at Holyrood elections and bigger nationwide parties at general elections.

It would therefore be premature to conclude that the vote ends any chance of another independence referendum. Polls on secession remain roughly where they were three years ago. But it will quieten talk on constitutional issues until nearer the next Holyrood election, in 2021. If that makes the SNP focus on the job of delivering public services then that is all the better.

What the general election also proves is that Conservatism is no longer a dirty word in Scotland. And as Conservatives south of the border reflect on the future of their party they will look to Mrs Davidson’s achievements. Unlike Mrs May, the Scottish leader offered a sunny, liberal version of Toryism. How Conservatives may wish she was an MP.

Note: This piece has been updated to reflect the total number of seats won by the SNP.