A federal judge has temporarily blocked the Trump administration from denying asylum to migrants who crossed the southern border illegally, saying the president violated a “clear command” from Congress to allow them to apply.

In a ruling late Monday, U.S. District Judge Jon S. Tigar of San Francisco issued a nationwide restraining order barring enforcement of the policy President Trump announced Nov. 8, which he billed as an urgent attempt to stop the flow of thousands of asylum-seeking families across the border each month.

The government had said it would allow only people who cross at legal checkpoints to request asylum. Those entering elsewhere could seek a temporary form of protection that is harder to win and doesn’t yield full citizenship. The changes would amount to a transformation of long-established asylum procedures, codified both at the international level and by Congress.

“Whatever the scope of the President’s authority, he may not rewrite the immigration laws to impose a condition that Congress has expressly forbidden,” wrote the judge, whom President Barack Obama nominated to the federal bench in 2012. Tigar reasoned that the “failure to comply with entry requirements such as arriving at a designated port of entry should bear little, if any, weight in the asylum process.”

The Trump administration said Tuesday it will continue to press the matter in court.

Labeling the movements of Central American migrants a “national emergency,” Trump deployed thousands of active-duty troops and coils of concertina wire to the border. Military officials have indicated they are weighing whether to redeploy some of those troops.

A U.S. defense official, speaking on condition of anonymity due to the sensitivity of the issue, said Tuesday that the military was examining whether Tigar’s order changes anything for their operations. However, U.S. troops already had been acting only in a support role to the Department of Homeland Security, with only incidental contact with migrants expected.

Tigar said the president could not shift asylum policy on his own. The judge’s order will remain in effect until Dec. 19, at which point the court will consider arguments for a permanent block of the policy.

The Trump administration suggested the defeat could be temporary, alluding to a 5-4 decision by the Supreme Court in June that upheld a revised version of Trump’s travel ban, an effort to bar foreigners from certain majority-Muslim nations and other countries from the United States.

“As the Supreme Court affirmed this summer, Congress has given the President broad authority to limit or even stop the entry of aliens into this country,” the Justice Department and the Department of Homeland Security said in a joint statement. “We look forward to continuing to defend the Executive Branch’s legitimate and well-reasoned exercise of its authority to address the crisis at our southern border.”

Central American migrants, as part of the Central American caravan trying to reach the United States, wait to receive a donated dinner in Mexicali, Mexico, on Nov. 19. (Rodrigo Abd/AP)

Tigar’s 37-page ruling was the latest in a string of court decisions blocking the administration’s hard-line immigration policies, including its efforts to crack down on “sanctuary cities” and to rescind deportation protections for about 1 million undocumented immigrants who were either brought to the United States as children or given temporary protected status in this country because of national disasters and unrest in their homelands.

The government is appealing those rulings.

The challenge to the asylum ban was brought by the American Civil Liberties Union and other advocacy groups on behalf of East Bay Sanctuary Covenant. The order reflects the judge’s view that the plaintiffs are likely to succeed on the merits, and would suffer irreparable injury from the executive action.

In his proclamation, Trump said the changes were necessary to prepare for the caravan’s arrival, arguing that asylum seekers had no “lawful basis for admission into our country.” In justifying the policy, the administration relied on the same emergency authority invoked as grounds for the “travel ban."

In a hearing Monday, Scott Stewart, a lawyer for the Justice Department, spoke of a “crushing strain” of migrants attempting to cross the border illegally. He alleged that most asylum claims were “ultimately meritless.”

But the judge seemed skeptical, observing that border apprehensions are near historic lows and that, regardless, federal law says all people on U.S. soil can apply for asylum, no matter how they arrived.

Tigar voiced concern for the fate of asylum seekers under the changes. The administration’s rule, he observed, would force people “to choose between violence at the border, violence at home, or giving up a pathway to refugee status.”

And in his decision, he wrote that the government’s argument that the manner of entry can be the lone factor rendering a migrant ineligible for asylum “strains credulity."

“To say that one may apply for something that one has no right to receive is to render the right to apply a dead letter,” he argued. “There simply is no reasonable way to harmonize the two.”

The judge pointedly denied the claim that the president, by fiat, could give the manner of entry added legal weight as a determinant of asylum. He reasoned that the “interpretive guide” of United Nations compacts on asylum lent extra force to congressional requirements. The intent of Congress, Tigar wrote, was “unambiguous.”

“And if what Defendants intend to say is that the President by proclamation can override Congress’s clearly expressed legislative intent, simply because a statute conflicts with the President’s policy goals, the Court rejects that argument also,” the judge found.

Lee Gelernt, the ACLU attorney who argued the case, welcomed the ruling in a statement.

“This ban is illegal, will put people’s lives in danger, and raises the alarm about President Trump’s disregard for separation of powers,” he said. “There is no justifiable reason to flatly deny people the right to apply for asylum, and we cannot send them back to danger based on the manner of their entry. Congress has been clear on this point for decades.”

As the hearing was underway Monday, Homeland Security Secretary Kirstjen Nielsen said the government had received reports that the migrant caravan was considering rushing the border and closed the travel lanes for a short period. Late last month, some in the caravan kicked and pushed their way through the Guatemala border into Mexico.

But a spokesman for the caravan said the Central Americans were waiting peacefully in Mexico and had no intention of forcing their way into the United States.

U.S. Customs and Border Protection closed the entire San Ysidro crossing in San Diego for several hours before dawn, installing additional layers of razor wire and concrete barriers, then reopened it with 10 of the port’s 26 vehicle lanes closed.

Clashing with the U.S. government is a frightening prospect for migrants. In May, a Border Patrol agent shot and killed Claudia Patricia Gómez González, 19, a Guatemalan citizen who had crossed into the United States illegally hoping to reunite with her longtime boyfriend. At the time, the Border Patrol officials said the officer had been attacked with blunt objects.

Nick Miroff and Dan Lamothe in Washington and Elise Ackerman in San Francisco contributed to this report.

Maria SacchettiMaria Sacchetti covers immigration for the Washington Post, including U.S. Immigration and Customs Enforcement and the court system. She previously reported for the Boston Globe, where her work led to the release of several immigrants from jail. She lived for several years in Latin America and is fluent in Spanish. Follow

Content from Allstate This content is paid for by an advertiser and published by WP BrandStudio. The Washington Post newsroom was not involved in the creation of this content. Learn more about WP BrandStudio.