WHAT can we say about this awkward, unwanted election, now it is finally over? The SNP under the leadership of Nicola Sturgeon will win in Scotland and Theresa May is still expected to win in the UK, but in both cases, victory comes dressed as defeat.

The SNP was always going to lose seats, mainly to the Scottish Tories, who will paint the borderlands and parts of the north-east of Scotland blue tomorrow. But the last-minute revival of Labour has thrown a question mark over Ruth Davidson’s claim to be leading the main opposition in Scotland.

Labour has leapt from a poor third in the polls to level pegging with the Scottish Tories in the last week or so. It is to the chagrin of the Labour tribe in Scotland, many of whose leaders loathe Mr Corbyn, that a man they said wasn’t fit to lead their party has turned out to be the star of the 2017 General Election.

You might have thought the SNP would be relatively pleased with a modest Labour revival since, in theory, it means that the Unionist vote will be split. A lot of Labour supporters were thought to be considering voting tactically for the Conservatives in order to register their opposition to a second independence referendum. But if Labour looks like being in with a shout in Westminster, it might make more sense to stick with their own party.

However, Ms Sturgeon does not seem to be even remotely gratified by Scottish Labour’s belated emergence from the political graveyard. Hence her decision to out the Scottish Labour leader Kezia Dugdale as a closet supporter of a second independence referendum – or at least as having said privately after the Brexit vote that she would not stand in the way of another independence referendum. This bombshell was dropped in the middle of the final STV debate before polling day and caused Ms Dugdale to respond furiously that the First Minister was “lying”. Ruth Davidson accused the First Minister of being a “clype”.

This is heavy, personal stuff and brought to mind the allegation in the 2015 General Election that Ms Sturgeon had told the French ambassador, privately, that she wanted David Cameron to win. That “Nikileaks” story led to profuse apologies from the former Scottish Secretary, Alistair Carmichael, for briefing the press, and to a costly court case. But it didn’t damage the First Minister, essentially, because it didn’t ring true. The difference this time is that Ms Dugdale did indeed equivocate last year about a second independence referendum if Scotland was forced out of the EU, as was reported by The Herald at the time.

But the more interesting question is why Nicola Sturgeon should want to aid the Scottish Conservatives, since the person who most obviously benefits from Kezialeaks is Ms Davidson. The Scottish Tory leader leapt upon the accusation and claimed it as proof positive that the only party truly committed to the Union is hers. If the Scottish Conservatives do indeed end up with seats in double figures tomorrow, then Ms Sturgeon will surely have played her part in delivering them.

Perhaps the view from the SNP is that it’s safer to have the Tories as the main Unionist opposition than Labour. Ms Sturgeon must see the danger of Scottish National Party supporters, especially younger ones, deciding to switch back to Labour now that it has a radical programme and a non-Blairite leadership. After all, the SNP cannot form a government on its own in Westminster, but Labour can. There is an obvious logic, even for SNP supporters, to vote Labour if they think there is a chance of Jeremy Corbyn ejecting the Tories from Number Ten.

All of which makes it difficult to forecast how this election is going to pan out. Will the anti-independence referendum vote outweigh the pro-Corbyn one? Will the May factor (the PM ran a dismal campaign) cancel out Ms Davidson’s appeal? Will many voters continue to believe, as they have in the past, that the best way to send a message to Westminster is to vote for the SNP?

Tactical voting has a long history in Scotland, and the Scottish Tories were wiped out by it 20 years ago. But never has tactical voting been more difficult; it’s more like three dimensional chess.

The border seats like Berwickshire, Roxburgh and Selkirk and Dumfries and Galloway look like Tory gains. Aberdeenshire and Kincardine also looks like going to the Tories but it seems unlikely that the SNP deputy leader, Angus Robertson, will lose in Moray, despite Tory forecasts. The SNP seems safe in Glasgow, where it seized control of the council after the May local elections, and in Dundee and Aberdeen. In Edinburgh, Labour’s Ian Murray should return in South, and the SNP will lose Edinburgh West, probably to the Liberal Democrats who have history there. The LibDems have an outside chance of Jo Swinson taking East Dunbartonshire from the SNP, and Jamie Stone has a chance in Caithness, Sutherland and Easter Ross. But with the late Labour surge, marginal seats become difficult to call.

This is a good thing. Politics is best when it’s unpredictable. The opinion polls have been of little help in this election, with wide variations of up to 10 points in their various calculations of Theresa May’s lead. The movements in Scottish opinion have been too rapid for the few-and-far-between polls to make much sense. So voters go to the polls today with few preconceptions.

But what we can say with some certainty is that the SNP will still be the dominant force on Friday morning. This is because so many Scottish seats are now safe for the party. In Glasgow, for example, there is no seat in which it won less than 50 per cent of the vote in 2015. This used to be Labour’s heartland, but it was swept away in the 2015 tsunami. The Conservatives were talking about returning up to 15 seats, but it is hard to see them returning more than half of that.

That won’t stop people declaring a moral defeat for Ms Sturgeon. It has certainly been a tough and bad-tempered election campaign, in which the SNP discovered that it now has a serious rival on the social democratic left. Whatever happens about independence, Ms Sturgeon will have to consider how to cope with this unlikely challenge from Jeremy Corbyn’s revived Labour Party.