Six new coronavirus cases were announced in Maryland and Virginia on Tuesday, and officials said several universities in the region will temporarily halt in-person classes in an effort to stop the virus from spreading.

Twenty-two coronavirus cases have now been reported in the region.

Loudoun County officials said a man in his 40s who tested positive had attended Christ Church in Georgetown, where both the rector and the organist also were diagnosed with the virus. The man is in good condition, officials said.

In Virginia Beach, the city health department said a man in his 60s and a woman in her 50s had contracted the virus while traveling on the same Nile River cruise line that has been linked to multiple other cases. Both are isolated and in stable condition.

A woman in Montgomery County who had traveled on the Nile River cruise line also was found to have the virus Tuesday, Maryland Gov. Larry Hogan (R) said. A Prince George’s County couple who took a cruise with that company have tested positive for the virus, as well.

Prince George’s County Executive Angela D. Alsobrooks said another county resident in her 50s, who tested positive for the virus Monday, appears to have contracted the virus while on a trip to Boston from Feb. 22 to Feb. 27.

Prince George’s officials declined to say if the woman was attending a conference in Boston that has been linked to dozens of other coronavirus cases. All three Prince George’s patients are self-quarantined at home and in good condition.

Alsobrooks (D) spoke at the county emergency operations center in front of a giant digital map of the nation with a ticker of global coronavirus cases that, during the news conference, read: 116,152.

“This is a virus, and we expect it to spread,” she said. “We believe the public has a role in helping us to prevent it from spreading. Viruses spread, the flu spreads. But we have the power in our community to keep it from spreading.”

Officials urged people who feel sick to stay home from work and school and repeated instructions for good hygiene, including thorough handwashing. School officials said health-related absences will be excused without a doctor’s note.

Both Maryland’s public university system and American University in the District announced plans to keep students away from campus for a short time after spring break, teaching them online instead of in person, in an effort to slow the spread of the virus in the region. Other colleges and universities throughout the country are taking similar steps.

Fairfax County Public Schools canceled classes for its 188,000 students Monday, so that teachers can attend training on how to conduct classes online, should that step become necessary.

The Alexandria school system sent an email to families Tuesday to say a small number of students and staff — fewer than a dozen — were self-quarantining because they had come into contact with people who have contracted the coronavirus or had visited foreign countries or traveled on cruise ships that were a concern. The individuals are affiliated with at least three school campuses in the city, a spokesman said. Those campuses were scheduled for deep-cleaning overnight.

The newly diagnosed patient in Loudoun County is sick but in good condition and self-isolating at home, county officials said. They said the man did not appear to have interacted with anyone who is elderly, immunocompromised or otherwise considered at high risk for covid-19, the disease caused by the virus.

“We are continuing to do everything in our power to keep Loudoun safe and healthy,” said Phyllis J. Randall (D-At Large), chair of the county board. “Any risk, right now, to the Loudoun community from this case remains low.”

Authorities say people can limit the spread of the virus, and their susceptibility to it, by staying home if they are ill, washing their hands frequently and avoiding people who have respiratory symptoms. People who develop fever, cough or shortness of breath should consult health-care providers about whether they should be tested.

At least three cases of the virus are connected to Christ Church, a historic Episcopal congregation.

D.C. Mayor Muriel E. Bowser (D) on Monday asked people who had been at the church Feb. 24 or between Feb. 28 and March 3 to quarantine themselves at home for a 14-day period. The specified dates were when the Rev. Timothy Cole, 59, the church rector who was diagnosed with the virus Saturday, was in the building and may have been infectious. Among other things, Cole attended a March 3 “Legos for Lent” event where small children and adults shared a buffet-style dinner, church spokesman Rob Volmer said.

Cole is hospitalized in stable condition. The church organist, Tom Smith, 39, tested positive for the virus Monday. He is in quarantine at his D.C. home “in good spirits,” with mild symptoms, Volmer said. Smith was at Sunday services March 1 and a choral event that evening, Volmer said, but did not attend other large events that week.

The diagnosis of the Loudoun man who attended the church was reported Tuesday.

Church officials have heard from families making up roughly 200 people who are self-quarantining, Volmer said. In addition to Smith, Volmer said, other church staff members and their immediate families have been tested, with results negative or pending.

Cole first became sick after returning from a Feb. 22 conference of Episcopal leaders in Louisville. D.C. health officials said they were still investigating where he may have contracted the virus. His case raised alarms because unlike most of the other patients in the region, he had not traveled overseas or anywhere that an outbreak has been confirmed.

Virginia Theological Seminary in Alexandria, Va., the largest Episcopal seminary in the United States, said Tuesday that a group of seminarians and two faculty members are under self-quarantine because they were in contact with Cole. Two seminary officials appeared at a March 3 event at Christ Church.

None of them are showing symptoms of the virus, but officials at the seminary are asking that people who are at higher risk for serious illness stay away from the campus.

D.C. Health Director LaQuandra S. Nesbitt said people who have come into contact with Christ Church attendees who are not showing symptoms of the coronavirus do not need to change their habits. She said parents should not panic, for example, if their child is attending school with someone who has been in contact with a patient but is not feverish or experiencing respiratory symptoms themselves.

“This notion that if a student who is a contact of an asymptomatic contact of a case attends a particular school that something needs to happen in that school is not scientifically driven,” she said.

Hogan said he has instructed all nursing homes and assisted-living facilities to limit visitors and bar their workers from international travel, measures he hopes will prevent an outbreak like the one in the Kirkland, Wash., nursing home where over a dozen residents have died.

“We want to do everything in our power to avoid that situation,” Hogan said at the start of a cabinet meeting in Annapolis. “This problem continues to evolve and escalate rapidly.”

Hogan and other officials said they expect a rapid rise in diagnosed cases as testing expands. Like the rest of the nation, Maryland will soon move from trying to contain the virus to mitigating its impact, he said.

In Prince George’s County, officials have told hundreds of people who worked at or attended the Conservative Political Action Conference at National Harbor late last month, including police officers and emergency personnel, to monitor themselves for symptoms. That’s because a person who attended the conference was diagnosed with the virus after he returned home to New Jersey.

Alsobrooks canceled three community forums this week, including a census workshop Wednesday.

All federal courthouses in the Eastern District of Virginia have suspended “non-case related outside events,” including tours and naturalization ceremonies, at least through the end of March.

In Fairfax County, elected officials worked to maintain calm while wrestling with questions about when to consider closing schools and canceling public meetings.

“I don’t think any one of us wants to be hosting the meeting that spreads this disease,” Fairfax County Supervisor Pat Herrity (R-Springfield) said. “I don’t want to panic, but I also want to be smart.”

Nick Anderson, Sarah Pulliam Bailey, Erin Cox, Dana Hedgpeth, Luz Lazo, Hannah Natanson, Darran Simon, Patricia Sullivan, Rebecca Tan, Rachel Weiner and Ovetta Wiggins contributed to this report.