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 meant 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.”

Discussing the guidance to avoid door-to-door guising this Halloween, Mr Swinney urged families not to leave sweets outside their homes as they could enable the transmission of Covid-19.

“The interaction of humans is how the virus is spread and that can also be spread by the touching of items like bags of sweeties,” he said.

“So quite conceivably, without anybody knowing that they were doing any harm to anybody else, somebody could give a child an assembled bag of sweeties – my son went out guising last year and from our very kind neighbours he got little bags of sweeties – those bags could be the purveyors of coronavirus.”