In the end, Nicola Sturgeon’s Scottish National party fell one seat short of the overall majority it coveted. Unionists should draw little solace. Including the Greens, the Scottish parliament elected on Thursday has a bigger majority from parties supporting a second independence referendum than its predecessor. The battle to save the UK may play out over a longer timeframe than it might appear today, but it is real. The government must figure out a way to win the argument, one way or another, to preserve the 314-year-old Union.

For now, it is reasonable for Boris Johnson to say the aftermath of a pandemic is no time for a divisive second plebiscite on a matter supposedly decided for a generation in 2014. Scotland’s first minister Nicola Sturgeon has given herself a window of two and a half years. While opinion polls for much of last year found that a majority of Scots who expressed a view backed independence, a majority also do not favour a quick referendum.

Support for independence has slipped in recent months, and may shrink further. Sturgeon was boosted by her plain-speaking style during the pandemic. As coronavirus recedes, Scottish voters may refocus attention on the SNP’s undistinguished domestic record. New Scottish Conservative and Labour leaders are showing signs of being better able to hold it to account.

If the mood does not shift, playing for time is not a sustainable strategy for Downing Street. Continually blocking a referendum will arm the nationalists, and convert more waverers. The UK has always worked by consensus. It will survive only if it remains a union by consent. Refusing sustained demands for a referendum will transform it into what looks like a union by coercion.

The government must work out how to win a referendum if it comes to it, and how best to sway opinion against one. Trying to bind Sturgeon into a Union-wide post-Covid recovery effort is rational, but risks looking cynically late. Johnson’s high-handed eschewal of much consultation earlier in the pandemic enabled both the SNP and the Welsh Labour administration to raise visibility and draw political gains.

The impulse to throw money at Scotland — as at disadvantaged newly Tory-voting areas of England — is natural but needs sensitive handling. Slapping union jacks on construction projects in Scotland could be counterproductive if it appears to ride roughshod over devolution. In last year’s Internal Market Act, London took control of ex-EU structural funds previously administered largely by the devolved administrations, and gave itself new powers to spend directly in Scotland and Wales.

To win over especially younger Scots who perceive little added value in the UK, the government should focus not just on selling the Union better but on making the Union better. That does not necessarily mean handing further powers to Edinburgh or Cardiff; experience suggests that only increases the appetite for more. It could mean recognising Scots’ yearning for a greater voice at Westminster — by, for example, turning the antediluvian House of Lords into an elected chamber from the UK nations and regions.

Before being granted any referendum, moreover, the SNP must be made to spell out how it would address the key risks of independence: how to balance the books when Scotland loses its fiscal transfer from the rest of the UK; and how, if it rejoined the EU, it would handle the border with England. Johnson knows he dodged similar questions in the 2016 EU referendum; he cannot allow Sturgeon to do something similar. Otherwise, he might go down in history not for getting Brexit done, but as the prime minister who lost the UK.