President Trump’s push to limit the number of asylum seekers flooding across the border suffered another defeat in the courts on Friday, when a federal judge ruled that the government cannot stop migrants from claiming asylum in the U.S., even if they have crossed the border illegally.

The decision concerned a policy announced by Trump in November that bars migrants who entered the U.S. across the southern border from being eligible for asylum unless they presented themselves at a port of entry. Trump has said he was acting in response to caravans of migrants making their way to the border.

SUPREME COURT REJECTS TRUMP BID TO ENFORCE ASYLUM CRACKDOWN

But the policy was temporarily blocked last year by a federal appeals court, which said it was inconsistent with federal law and was an attempt to bypass Congress. The Supreme Court later blocked the immediate enforcement of the policy in a 5-4 decision in December.

On Friday, Judge Randolph Moss said that the president had determined that the influx of migrants across the border poses a “particular problem for the national interest,” but Moss ruled that the assessment “is neither sufficient to override a statutory mandate permitting all aliens present in the United States to apply for asylum” whether or not they arrived at a designated port of entry.

The judge was referring to the 1965 Immigration and Nationality Act (INA), which defines who may apply for asylum, and says that any one physically present in the U.S. may do so regardless of whether or not they entered via a designated port of entry.

The case was brought by 19 asylum seekers from Central America, who entered the U.S. between ports of entry and claimed that the president's restrictions were illegal on a number of counts -- including that it is inconsistent with the INA.

According to the ruling, the government argued that while the INA says that illegal immigrants may "apply" for asylum, the rule does not stop them from applying but instead makes them "ineligible" for asylum. Judge Moss dismissed this argument as a distinction without a difference.

"As a matter of common usage, no one would draw a meaningful distinction, for example, between a rule providing that children may not apply for a driver’s license and one providing that children are not eligible to receive a driver’s license," he wrote. "Both locutions mean the same thing."

"The Rule’s direction that 'an alien shall be ineligible for asylum' if the alien entered the United States outside a designated port of entry is not 'compatible' with the congressional mandate that all aliens present in the United States may 'apply' for asylum, regardless of whether they entered the United States at a designated port of entry," he said.

The case is one of a number of challenges to the Trump administration’s efforts to crack down on migrants coming across the border and claiming asylum. The administration has said it is trying to cut down on magnets that act as a pull force for migrants, including rules that limit how long family units can be held in detention.

FEDERAL COURT BLOCKS TRUMP ASYLUM RULES HOURS AFTER JUDGE RULED TO KEEP RESTRICTIONS IN PLACE

Last month Trump announced a “safe third country” deal with Guatemala that would requires migrants who cross into the country to apply for asylum there instead of at the U.S. border. However, that too faces court challenges in both Guatemala and the U.S.

Also last month, a California federal judge blocked a rule that would require migrants to first apply in one of the countries they cross on their way to the U.S. -- with certain exceptions. The rule is targeted at tens of thousands of Central Americans who cross Mexico each month trying to enter the U.S.

CLICK HERE TO GET THE FOX NEWS APP

The policy follows the Trump administration's Migrant Protection Protocols, commonly referred to as the "remain in Mexico" policy. Under that policy, asylum seekers were often told to go back to Mexico to await hearings, rather than be allowed to remain in the U.S.

But those restrictions have seen fierce opposition not only in the courts, but in Congress, where Democrats have decried the efforts as cruel and inhumane.

Fox News' Bill Mears, Ronn Blitzer and The Associated Press contributed to this report.