In a message to students on Friday, St Andrews principal Professor Sally Mapstone asked students to enter a voluntary weekend lockdown.
She warned the situation is “just as serious” as when the pandemic took hold in March.
Prof Mapstone said: “It is now very clear that rates of Covid infection are surging again in various parts of this country, and it is very likely that we are very close to a form of further national lockdown.
“The First Minister of Scotland has today spoken of the urgent need to interrupt the chain of transmission of the virus.
“In these circumstances, I am writing to all of our students to ask you to please observe a voluntary lockdown this weekend, effective from 7pm this evening.
“This means that I am asking you all to remain in your rooms as much as possible, not to party, not to go to bars or restaurants, and to avoid mixing with any groups outside your own households. Catering will continue as normal in halls of residence.
“I appreciate that this request will appear to some of you to be premature, but a hallmark of this pandemic has been that, as a society, we have acted too slowly in the past, and thousands of people have died unnecessarily as a result.
“Early action saves lives, and we have an opportunity as one community to take action to protect ourselves, and those with whom we share this town.
“We acted swiftly in March when the pandemic first hit Fife, and the situation we face now is just as serious.”
She said all planned events over the weekend should be postponed, including sports and social activity.
Prof Mapstone added: “I must stress that this is preemptive and proactive action. There is no evidence that the virus is surging in our community.
“Rather it is because as a country we are now in a very fast-moving phase where early intervention is key, and hours make a difference.”
She said the situation will be kept under review throughout the weekend.
Last Friday police were called to disperse a gathering of about 50 young people on a beach in the town.
The previous day, NHS Fife said two people with links to the university had tested positive for Covid-19.
They were said to be experiencing mild symptoms and self-isolating at home.
The health board said: “There is no evidence at this stage that the two cases are linked and the risk of onward transmission within the wider community is considered to be low.
“The likely source of infection in both cases is understood to have been as a result of close contact with confirmed cases outwith the Fife health board area.”