For Gracie Kreth, the news Wednesday that the University of Virginia will soon switch to online teaching in an effort to prevent coronavirus infections wasn’t too surprising. She knew U-Va. was following the prudent path taken by many other universities to respond to what is now a global pandemic.

It was still painful.

Kreth, 21, a senior from Little Rock, is weeks away from graduating with a double major in English and media studies. Her schoolwork is well in hand. But she was looking forward to hanging out with friends and classmates and savoring their days in Charlottesville before commencement. Now, it looks like they will all be dispersed, at least for now, in the interest of public health.

“I understand that it’s a necessary call to cancel classes and large gatherings,” Kreth said. “But I’m also just very sad that I won’t have these last weeks at school.”

Hundreds of thousands of college students in the Washington area and beyond face sudden upheaval as academic plans are being reworked on the fly during and after their spring breaks. On Wednesday, U-Va. and Catholic, Gallaudet, Georgetown, Howard and Marymount universities in the region announced temporary suspensions of in-person teaching.

“We will not be holding classes on Grounds for the foreseeable future, quite possibly through the end of the semester,” U-Va. President James E. Ryan wrote in a message to the university, using U-Va.'s distinctive capital-G term for its campus. The online classes will start March 19, he said, and officials will reassess that shift after April 5 at the earliest.

Ryan said students who are on break this week were “strongly encouraged” to remain at home.

“These are obviously significant steps that will cause disruption and disappointment, which we all regret,” Ryan wrote. “We nonetheless feel compelled to take these steps in light of the most recent evidence. The virus continues to spread nationally and in Virginia.”

Elsewhere in the country, more universities were announcing measures to keep students away from campus and deliver instruction through cellphones and laptops. Among them were the City University of New York, State University of New York, University of Michigan, University of Notre Dame, Oberlin College, Grinnell College, Cornell University and the Massachusetts Institute of Technology.

At Michigan State University, where many students had just returned from break, officials announced they had learned Wednesday that public health officials were monitoring a person linked to the campus. The university suspended in-person classes at 1 p.m. Wednesday, until April 20, and strongly encouraged people to leave campus if they could and continue classes remotely.

All public universities in North Carolina will end in-person classes no later than March 20, the University of North Carolina System announced, a change that will last indefinitely. Some classes, such as labs, will continue to require in-person attendance, they noted.

At the University of Dayton, in Ohio, officials announced Tuesday that classes were suspended for the rest of the week and would continue online after spring break. Students were told they had to leave their dorms. That night, a disorderly crowd of more than 1,000 people gathered on a street near student housing. Some of them threw things at police who sought to clear the street. By early Wednesday, the crowd dispersed.

“Although there were some social media reports and rumors this was a protest against our coronavirus measures — those reports are inaccurate,” the university said afterward. “Indications are that the students wanted one last large gathering before spring break, and the size and behavior of the crowd required police to take action.” On Wednesday afternoon, the university said, the campus was quiet as students headed home.

In the District, Georgetown University said all of its schools will switch to “virtual learning environments” and that there will be a complete halt to face-to-face classroom instruction starting Monday.

It warned that the measures would remain in place until further notice as the situation evolves. The university has about 19,000 students enrolled in many academic units, including its renowned School of Foreign Service, schools of business and medicine, the undergraduate college and the nation’s largest law school.

“We strongly encourage undergraduate students to return to their permanent addresses while this virtual learning environment is in place,” Georgetown President John J. DeGioia wrote in a letter to the campus. “Students should avoid returning to campus if possible or return to campus briefly to gather necessary items for the completion of academic work before departing to their permanent addresses.”

DeGioia added: “I recognize that this transition to virtual learning will be very challenging and I am deeply grateful to our faculty for their dedication and commitment to our students during these difficult times.”

Howard University, also in the District, said Wednesday it will provide online instruction from March 23 through April 6. “While we anticipate that most students will remain home following Spring Break,” Howard said in a statement, “the University will provide accommodations for students whose financial circumstances may prevent them from having a place to stay until April 6.”

On Tuesday, the University of Maryland and American, George Washington and Johns Hopkins universities took similar steps to move toward temporary online education.

In Virginia, some other major public universities were taking steps similar to U-Va.'s. The College of William & Mary, in Williamsburg, is suspending in-person classes starting March 23 for its 8,800 students.

“Students are strongly encouraged to return home or stay home,” William & Mary President Katherine A. Rowe said. “For those for whom this is not a realistic option, you are welcome on campus.”

Virginia Tech, which is based in Blacksburg, said it will give students an extra week for spring break, through March 22. The next day, it will move to online and remote instruction, using videoconferencing and other digital tools, for all undergraduate and graduate students at all campuses for the remainder of the spring semester. That will be a major undertaking for a school with 35,000 students.

“We will do everything possible to ensure that these changes do not impact your academic progress,” Virginia Tech President Timothy Sands wrote in a message to those students.