University students may not be allowed to return home over Christmas if coronavirus is not under control, Scotland’s Education Secretary has warned.

John Swinney said there is a “realistic possibility” they could be asked to stay in halls or other university accommodation at Christmas but stressed the Scottish Government “want to avoid that at all possible cost”.

Phased returns home and back to university are being considered by the UK’s governments as part of an attempt to limit further infections by the movement of “substantial” numbers of people around the country.

Speaking on the BBC Good Morning Scotland radio programme, the Deputy First Minister said the return of students at Christmas “without a doubt” depends on the coronavirus infection rate being reduced.

Asked if that means students could be forced to remain in halls of residence, he said: “We want to avoid that at all possible cost because we want students to return home.

“But I have to be realistic that, if we have a situation where the virus has not been controlled, then we will have to look at other scenarios and other plans.”

Mr Swinney added: “There is a lot of thinking and work going on within the Scottish Government, with Universities Scotland, the institutions, with the National Union of Students, and also with the governments in England, Wales and Northern Ireland to try to make sure this can be undertaken as safely as possible.

“But there obviously is a risk that if the virus is not contained, then we may not be able to support the return of students to their homes.

“We want to avoid that but it is a realistic possibility.”

First Minister Nicola Sturgeon told the Scottish Government’s coronavirus briefing on Monday that she understands students will be “worried and anxious” about the prospect of being unable to return home at Christmas but she does not want to give them “false assurances”.

“We will do everything we can over the next few weeks to set out a path that sees you able to return home for Christmas, that is what we all want to see,” she said.

Ms Sturgeon confirmed the Scottish Government is looking at phased term dates and possible testing of students and issues of people returning home where there are vulnerable people.

The First Minister added: “We will set that out as early as we can, with as much certainty as we can, but the really difficult thing in all of this is that we are living through an inherently uncertain and unpredictable pandemic.

“That means we can always give the absolute cast-iron certainty on anything right now that I know people desperately want and I desperately would like to be able to give.”

Scottish Labour education spokesman Iain Gray said: “Students have already been at the sharp end of ad-hoc policy-making by the Scottish Government and now face further dithering and delays.

“We must have assurances that the Government has a robust plan in place to ensure a safe return of young people to their families for Christmas, including the testing of students before they can safely return home and then again when they head back to university after the holidays.”

Scottish Conservative education spokesman Jamie Greene said: “(The SNP) can ill-afford to repeat their chaotic mistakes that students endured when they returned to university in September, leaving many alone and with no support.

“John Swinney seems to be taking a ‘just wait and see’ approach, which offers very little comfort that thousands of young people will actually be able to see their families this Christmas.

“Proper planning, co-ordination and communication is needed this time round and the SNP must work constructively with other parts of the UK over this to get it right.”