Stanford is clearing students off of its campus after learning that an undergraduate has tested positive for coronavirus.

In a message to the university Friday, President Marc Tessier-Lavigne told the vast majority of Stanford’s undergraduates they will need to move out of their dorms and leave the university by Wednesday.

And Tessier-Lavigne announced a slate of changes — including prohibiting gatherings of 35 or more people and requiring that dining halls serve only to-go meals — meant to slow the spread of the virus on campus.

Stanford called off in-person classes earlier this month, and previously confirmed that a faculty member tested positive for coronavirus. Other universities around the Bay Area and across the country have taken similar steps.

But Stanford leaders escalated their containment plans after learning Friday that an undergraduate tested positive for the virus, becoming the university’s first student with a confirmed case. Tessier-Lavigne said the student is now self-isolating, and that officials are reaching out to people the student has had contact with.

“It is clear that we need to take a next wave of actions to help slow the spread of COVID-19 in our community,” Tessier-Lavigne wrote in his message. “These are very difficult actions to take, but we are asking individuals to make deep sacrifices for the good of those in our community who are most vulnerable to the threat of infection.”

Only a small number of students “who have no other option than to be here” will be allowed to stay in Stanford’s on-campus housing, Tessier-Lavigne said, such as international students who cannot travel home, those with health risks and those who are homeless. Everyone else must leave “as soon as possible,” and by 5 p.m. Wednesday at the latest, he said.

Stanford officials will notify students by noon Saturday whether they will be allowed to stay on campus.

Those who remain will find college life transformed: There will be no social events or parties, all gyms and recreation centers will be closed and students won’t be allowed to bring guests onto campus, Tessier-Lavigne said.

Related Articles The Latest: Italy records more than 1,600 new virus cases

Coronavirus: Santa Clara County passes 20,000 cases amid statewide decline

Watch: Where are California’s coronavirus case rates dropping, and how far?

When will the COVID-19 vaccine be ready?

Alameda County has reported a huge COVID-19 death total in recent weeks. Here’s why. Already on Saturday, the university had changed its rules for campus dining halls to comply with county limits on gatherings — students won’t be allowed to eat at the cafeterias, and will receive pre-filled to-go meals they must take outside or back to their dorms.

The university is also asking professors to make final exams for the winter quarter optional.

“I know how very difficult and deeply disappointing these steps will be for many students,” Tessier-Lavigne wrote. “We are taking these new actions to support your health and safety, and to align our operations with quickly changing developments.”