The University of North Carolina at Chapel Hill, one of the largest schools in the country to bring students to campus for in-person teaching, said Monday that it will pivot to all-remote instruction for undergraduates after testing showed a pattern of rapid spread of the novel coronavirus.

The shift signaled enormous challenges ahead for those in higher education who are pushing for professors and students to be able to meet on campus. Officials announced the abrupt change just a week after classes began at the 30,000-student state flagship university.

They said 177 cases of the dangerous pathogen had been confirmed among students, out of hundreds tested. Another 349 students were in quarantine, on and off campus, because of possible exposure to the virus, they said.

The remote-teaching order for undergraduate classes will take effect Wednesday, and the university will take steps to allow students to leave campus housing without financial penalty. The actions are likely to reverberate in North Carolina and beyond, including other major public universities that have hopes of playing college football in the fall. UNC-Chapel Hill’s Tar Heels teams play in the Atlantic Coast Conference.

“We understand the concern and frustrations these changes will raise with many students and parents,” UNC-Chapel Hill’s chancellor, Kevin M. Guskiewicz, and provost, Robert A. Blouin, wrote in a statement. “As much as we believe we have worked diligently to help create a healthy and safe campus living and learning environment, we believe the current data presents an untenable situation.”

The leaders pointed out a bright side: “So far, we have been fortunate that most students who have tested positive have demonstrated mild symptoms.”

In Chapel Hill, clusters of coronavirus cases had popped up in three residence halls and a fraternity house in the first week of the fall term, sending students into isolation and quarantine rooms and raising faculty worries about how far the virus will spread in the campus community.

The public health conditions at UNC-Chapel Hill were being closely watched as colleges and universities around the country move this month toward the first day of class, some with entirely remote instruction and others with a mix of teaching online and in person.

Among 100 major public universities — two per state — an analysis from Davidson College found that 23 have plans to teach primarily in person or offer a “hybrid” of face-to-face and online. Those with in-person plans, the analysis found, include the universities of Alabama, Georgia, Iowa and Kentucky.

Reports have emerged of risky gatherings of students in close quarters, without masks, in college towns including Tuscaloosa, home of the University of Alabama, and Dahlonega, home of the University of North Georgia. A cluster of 23 confirmed coronavirus cases also hit a sorority house at Oklahoma State University.

At the University of Notre Dame, which is also one week into its term, there have been 58 confirmed coronavirus cases this month. The prestigious Catholic university, with 12,000 students, is teaching primarily in person.

But Notre Dame officials are keeping a close eye on off-campus parties in South Bend, Ind. “That has caused us concern,” Paul Browne, the university’s vice president for public affairs and communications, said.

In the week before class started Aug. 10 at UNC-Chapel Hill, 10 students and one employee tested positive, according to the university. But clusters of cases piled up in the residences known as Granville Towers, Ehringhaus and Hinton James, as well as the Sigma Nu fraternity house, according to text alerts the university sent students in recent days. A UNC-Chapel Hill dashboard shows 130 students tested positive last week out of 954 tested. Five employees also tested positive.

“After only one week of campus operations, with growing numbers of clusters and insufficient control over the off-campus behavior of students (and others), it is time for an off-ramp,” Barbara K. Rimer, dean of public health at UNC-Chapel Hill, wrote in a statement Monday. “We have tried to make this work, but it is not working.”

Faculty, too, were calling for a review of the situation.

“The fact that it is happening this early in the school year, just a week into classes, has everyone quite concerned and quite alarmed, quite frankly,” said Mimi V. Chapman, a professor of social work who is chair of the UNC-Chapel Hill faculty.

Clusters are defined as at least five cases in a residence.

The public university has about 20,000 undergraduates and 10,000 graduate students. This month it is housing about 5,800 students in campus housing — less than two-thirds of capacity — with many more students living off campus in Chapel Hill and nearby communities. More than half of classes had at least some in-person teaching on opening day, although many faculty have been switching in recent weeks to all-online delivery.

Before the first day of class, university officials said they were confident in their plans but would closely monitor how many cases emerge and other data, including the number of students in quarantine.

Officials say many students appear to be taking public health seriously. Masks are worn all around campus, they said, and students are maintaining physical distance from each other when they go to class.

“It has been heartening to hear reports from faculty and staff and to experience for myself the excellent compliance on campus this week,” the provost, Blouin, wrote Thursday. “Our goal, certainly, is full participation both on campus and off among all members of our Carolina community.”

But they were deeply concerned about gatherings off campus. The UNC-Chapel Hill chancellor, Guskiewicz, wrote a letter recently warning fraternities and sororities and other groups that they must follow health rules.

One dorm was set aside to isolate those who test positive and another to quarantine those who had come into close contact with confirmed cases. One ­first-year student, who spoke on the condition of anonymity for privacy reasons, told The Washington Post on Monday that she had been in quarantine since Thursday night. This student said the problem arose because she had breakfast one day just off campus with a classmate who later tested positive.

“I was definitely worried,” she said. “I kind of broke down when I first got here.” But she said she has adjusted and is resigned to waiting for her viral test results and living apart from her peers for two weeks.

She said her meals are delivered, including a turkey sandwich for lunch and grilled chicken for dinner, as well as a supply of Pop-Tarts, oatmeal and cans of soup. “I was told I could only leave if I need a breath of fresh air,” she said.