Princeton University will offer housing to all of its enrolled undergraduates in the spring semester, a major move toward opening up its campus after concerns about the coronavirus pandemic led the university to keep most students away in the fall.

Christopher L. Eisgruber, president of Princeton, told students Tuesday that the university will continue to enforce strict public health protocols and hold most classes online, regardless of where they live. But he said the Ivy League university in New Jersey now thinks it can safely house thousands of undergraduates using a combination of measures, including regular and intensive testing for the coronavirus.

He warned that conditions will be tightly regimented, especially at the outset of the term in February. Students will quarantine when they arrive, they will not be allowed to hold parties or host visitors, and their travels will be restricted.

“We hope, but cannot guarantee, that there will be opportunities to increase interaction, and to phase in more activities, as the term progresses,” Eisgruber wrote in a letter to students.

Princeton housed fewer undergraduates this fall than several other Ivy League schools. In all, it accommodated about 250 who had special housing needs. The University of Pennsylvania had a similarly low total on campus: 222.

Others opened up far more: Cornell University had 4,904 undergraduates on campus or in university-owned housing. Dartmouth College had about 2,000 living on campus, Yale University 1,900, Harvard University 1,500, Brown University 1,100 and Columbia University 900.

In the spring, Eisgruber said in an interview, he expects Princeton will house 3,000 to 4,000 undergraduates out of the 4,500 who are now enrolled. Ordinarily, the university has about 5,200 undergraduates.

This year many opted to defer enrollment or take leaves of absence, Eisgruber said, while the pandemic has limited campus activities and in-person teaching.

Many parents and students have pushed Princeton and other universities to open up more in the spring. But the recent surge of the pandemic has complicated the calculations for higher education leaders.

Eisgruber said he is mindful of rising virus case counts. But he said he has concluded that the university can create a “bubble” that will protect the health of faculty, staff and students. Students will sleep one per bedroom and will submit saliva samples for coronavirus testing at frequent intervals. The university, which does not have a medical school, set up a laboratory to process the tests. It also will set up isolation and quarantine housing to respond to any outbreaks. Such measures have enabled other schools to operate housing in the fall.

“The news on the pandemic keeps getting worse,” Eisgruber said. “But the news on college campuses is in many ways better than people anticipated at the beginning of the term.”