Sahil Kapur for NBC News

Adam Glanzman / Bloomberg via Getty Images file

The government announced Monday that international students will not be allowed to stay in the country if the institution in which they’re enrolled is holding online-only courses this fall, and those failing to comply with the rules will risk deportation.

Students on F-1 and M-1 visas who face such a situation “must depart the country or take other measures, such as transferring to a school with in-person instruction to remain in lawful status,” the Immigration and Customs Enforcement agency said in a news release.

Those who violate the rules “may face immigration consequences including, but not limited to, the initiation of removal proceedings,” the agency said.

The news comes as some colleges and universities, including Harvard, have announced they plan to hold online-only courses this fall as the United States struggles to get the coronavirus pandemic under control.

The new rules are a blow to many international students who will be forced to either leave the country or scramble to transfer to a new school to keep their legal status. Some who exit the country will face hurdles to learning online, such as varying time zones.

The agency’s guidance stated that students in institutions with a hybrid of online and in-person courses may take multiple online classes, while current limits will remain for colleges and universities holding normal in-person classes.

The new rules “should not affect students participating in OPT,” an agency spokesperson said, referring to the optional practical training program that allows F-1 students who have finished their study to work in the U.S. for up to one year in a relevant field.

International students are 5.5 percent of the higher education population in the U.S., totaling nearly 1.1 million in the 2018-2019 academic year, according to the Institute of International Education.

Because they generally receive little or no financial aid, foreign students tend to pour large amounts of money into U.S. higher education institutions, which subsidizes Americans.

The new regulations represent the latest in a series of moves by the Trump administration to restrict legal immigration and visas during the COVID-19 pandemic.

The agency’s rules require schools to “update their information in the Student and Exchange Visitor Information System (SEVIS) within 10 days of the change if they begin the fall semester with in-person classes but are later required to switch to only online classes, or a nonimmigrant student changes their course selections, and as a result, ends up taking an entirely online course load.”