President Trump announced in a tweet late Monday night that he plans to suspend immigration to the United States, a move he said is needed to safeguard American jobs and defend the country from coronavirus pandemic, which he called “the Invisible Enemy.”

“In light of the attack from the Invisible Enemy, as well as the need to protect the jobs of our GREAT American Citizens, I will be signing an Executive Order to temporarily suspend immigration into the United States!,” the president wrote, announcing the plan at 10:06 p.m.

Trump, who is running for reelection on his immigration record and his effort to build a wall on the Mexico border, has long been frustrated with the limits on his ability to seal off the United States by decree. An executive order suspending all immigration to the country would take the president’s impulses to an untested extreme.

Two White House officials said an executive order is being drafted and that Trump could sign it as soon as Tuesday. The order, which was discussed among senior staff members Monday, would suspend nearly all immigration under the rationale of preventing the spread of infection by foreigners arriving from abroad.

The United States currently has more confirmed coronavirus cases, by far, than any other country, with more than 775,000; the next highest country is Spain, with 200,000 cases. The United States also has far more confirmed virus-related deaths — more than 42,000 — than any other nation; Italy has more than 24,000 deaths and Spain just fewer than 21,000.

It remains unclear what exceptions Trump could include in such a sweeping immigration order, or if would-be immigrants could reach the United States by demonstrating they are free of the virus. The White House officials said they thought the order would not be in place long-term.

The president’s announcement caught some senior Department of Homeland Security officials off guard, and the agency did not respond to questions and requests to explain Trump’s plan late Monday.

The United States already has placed broad restrictions on travel from Europe, China and other pandemic hot spots, while implementing strict controls at the country’s land borders. International air travel has plummeted.

Halting immigration to the United States ould affect hundreds of thousands of visa holders and other would-be green card recipients who are planning and preparing to come to the United States at any given time. Most of them are the family members of Americans.

For Trump’s executive order to work, it would have to direct the State Department and U.S. Citizenship and Immigration Services to immediately stop the issuance of immigration visas. Such a move appears to have no modern precedent and would potentially leave the fiancees, children and other close relatives of U.S. citizens in limbo.

The State Department issued about 460,000 immigration visas last year, and USCIS processed nearly 580,000 green card approvals for foreigners who applied for permanent residency, the latest U.S. statistics show.

Alex Nowrasteh, the director of immigration studies at the Cato Institute, a libertarian think tank, said that the president likely does have the authority to issue such an order during a time of crisis.

Nowrasteh said there are at least two legal justifications for Trump to close the border to all immigration: Title 42 of the U.S. Code enables the president to halt immigration for health reasons, while a 2018 U.S. Supreme Court decision upholding his travel ban gives him legal precedent.

If such an order were in fact signed, it would be unprecedented in American history, Nowrasteh said. During the height of the 1918 flu pandemic, the United States allowed more than 110,000 immigrants to enter the country.

And during World War II, the United States accepted more than 170,000 immigrants with green cards and more than 227,000 temporary agricultural workers, mostly from Mexico, on the bracero guest worker visa program.

The president already has largely halted most forms of immigration into the United States, Nowrasteh said. This latest move continues his restrictionist immigration policies and takes them to a new level, using the pandemic as the reasoning.

On March 18, the State Department canceled most routine immigrant and nonimmigrant visa appointments at its offices overseas, effectively shutting down almost all new kinds of travel into the United States. The State Department also stopped all processing for refugee resettlement.

Later that week, however, authorities resumed processing H-2A visas for seasonal guest workers. The country's agricultural laborers have been officially declared “essential workers,” including hundreds of thousands of people who enter the country under that temporary visa.

Nowrasteh said he was surprised that it took Trump so long to use the pandemic and the cause of public health as justification to achieve one of his highest policy priorities.

“The president has been opposed to legal immigration for his entire administration,” he said. “This is an opportunity to close it down entirely, and this is about as legitimate as you can get in terms of a broad justification for doing so.”

Trump already has cited the health emergency to enact the kind of enforcement measures at the U.S. border with Mexico he has long extolled, moves that have essentially closed the border to asylum seekers and waved off anti-trafficking protections for underage migrants. During the past few weeks of the coronavirus crisis, U.S. border authorities have expelled 10,000 border crossers in an average of just a little more than an hour and a half each, which has effectively emptied out U.S. Border Patrol holding facilities of detainees.

U.S. border authorities say the measures are in place to help federal agents, health-care workers and the public by preventing potentially infected migrants from crossing into the United States, while minimizing the population of detainees in U.S. immigration jails.