(CNN) The White House counsel's office has been using the lessons learned from court battles over President Donald Trump's various travel bans and immigration crackdowns to impose new travel restrictions aimed at containing the spread of coronavirus , according to an administration official.

And with no end in sight to the current crisis, it remains to be seen how long the sweeping restrictions will stay in place.

Not since the September 11, 2001, attacks has the executive branch sought such broad actions to stem the flow of people into the country. Since January, the White House counsel's office -- along with the coronavirus task force -- has been grappling with legal questions regarding the imposition of sweeping travel bans in the name of public health as the various countries contend with the contagion.

The measures, while effective and expected in such a pandemic, have some of the administration's critics warning about the dangers of letting them go unchecked.

"Reasonable minds can disagree about what travel restrictions are necessary to protect public health in a pandemic like this," said Doug Rand, co-founder of Boundless Immigration, an immigration information platform. "Everyone would agree that some level of travel restrictions are necessary -- the question is: how long will they last, will they be geographically disparate for unstated discriminatory reasons and how much of this is being done for legitimate public health purposes, versus a restrictionist heyday?"

In January, the administration said it would expand Trump's contentious travel ban, suspending immigrant visas for citizens of four countries — Nigeria, the most populous country in Africa, Myanmar (also known as Burma), Eritrea and Kyrgyzstan -- and barring people from Sudan and Tanzania from the US diversity visa program, which awards green cards to immigrants. The announcement followed earlier efforts by the administration to block travelers from certain Muslim-majority countries.

That same day, the Trump administration announced it would suspend entry into the US by any foreign nationals who had traveled to China in the previous 14 days, excluding the immediate family members of American citizens or permanent residents, as it attempted to stop the spread of coronavirus to the US. By then, 213 people had died of the virus, and nearly 9,800 had been infected worldwide.

"When we imposed travel restriction on China, even though we've used travel restrictions before, this was actually a novel way to close down our borders because of a public health threat -- even with Ebola, this didn't happen," the administration official said. "Now that these (travel ban) cases have been litigated, we knew what we could do and we didn't have to worry about the courts trying to stop it."

Trump's travel and immigration crackdowns early in his presidency prompted a series of lawsuits accusing him of taking extrajudicial measures in the name of national security. In Trump v. Hawaii, the landmark case that upheld the third iteration of Trump's travel ban, the Supreme Court held that the Immigration and Nationality Act "entrusts to the President the decisions whether and when to suspend entry, whose entry to suspend, for how long, and on what conditions."

The sole prerequisite is that the President must find that "the entry of the covered aliens would be detrimental to the interests of the United States," the Court said.

White House officials used this legal rationale as a means for imposing sweeping restrictions on travel to and from China, the European Union's Schengen Area -- a zone of 26 European countries that do not have internal borders and allow people to move between them freely -- plus the United Kingdom and Ireland, when Covid-19 cases began making their way across the globe.

"It's a flexible authority that we can use for these purposes," the official said. "It's like the Muslim ban, but on almost the whole of Europe."

The Trump administration announced last week that it was temporarily closing the northern border and limiting travel across the southern border to cap the spread of coronavirus, raising hairs with critics who have fought the administration over its immigration crackdown on the southern border.

According to this official familiar with the efforts, the White House turned to public health service law, which says that the US surgeon general "shall have the power to prohibit, in whole or in part, the introduction of persons and property from such countries or places as he shall designate in order to avert such danger, and for such period of time as he may deem necessary for such purpose."

The idea is to minimize health risks at the border, although the statute empowers Border Patrol officers to apprehend migrants between ports of entry and return them to Mexico absent the standard processing.

The portion of the Tariff Act of 1930 cited by the White House states that, in times of emergency, the President has the authority to eliminate, consolidate, or relocate any office or port of entry of the Customs Service -- a measure specifically related to the closure of the northern border with Canada

Asked last week how long the border closure with Canada will continue, Trump told reporters, "I would say 30 days, and hopefully at the end of 30 days, we'll be in great shape."

While much of the efforts of White House lawyers have been focused on travel, other legal issues have arisen concerning supply chains, public health, telehealth and other such measures.

"The legal work is truly nonstop," this person said.

On March 13, Trump declared the coronavirus pandemic a national emergency, invoking powers under the National Emergency Act and the Stafford Act. These actions opened the door for the authorization of waivers that provide a temporary relaxation of certain -- but not all-- health care regulatory requirements in the event of a declared disaster or emergency

On Wednesday, Trump also issued an executive order invoking the Defense Production Act to prioritize the production of much-needed medical equipment and supplies to combat the novel coronavirus. Realistically, the new executive order mostly classifies health and medical resources needed to respond to the spread of coronavirus in a way that authorizes the administration to later have private businesses defer to government contracts over other contracts.

Trump told reporters at the White House last week that he would not be opposed to using executive authority for a number of other measures, but he didn't offer any details. White House officials say there are no imminent executive orders in the works with regard to the government's response to Covid-19.

The White House didn't immediately respond to a request for comment. However, officials at the White House acknowledge that the circumstances surrounding these measures may receive some pushback from Trump's critics and other civil liberties activists, particularly if the administration delays lifting these regulations for any reason. However, they say that the nature of this crisis allows them to take extraordinary measures in the name of public health.

"Everyone wants to sue Trump, but who wants to sue Trump so much that they are going to stand in the way of us trying to get this crisis solved?" this person familiar with the efforts asked.

"There's always a danger of overreaction in a time of emergency," said Jonathan Hafetz, a law professor at Seton Hall University. It "would be very problematic to try to expand executive powers that aren't at least reasonably related to the emergency measures that need to be taken and aren't grounded in law."