"Aliens [undocumented immigrants] have a statutory right to seek asylum regardless of whether they enter the United States at a designated port of entry, and Defendants [Trump administration] may not extinguish that statutory right by regulation or proclamation", US Judge Randolph Moss said in the court filing on Friday.
US President Donald Trump has repeatedly railed against the nation's immigration system.
In 2018, the US president passed a series of measures that made it harder for asylum seekers to pass the credible fear interview, the first step in the process.
In November, Trump issued an order requiring anyone who entered the United States illegally not to be eligible to request asylum, but the ban was rejected by a US judge.
In July, the Department of Homeland Security announced that migrants would only be eligible for asylum if they were trafficked into the United States, denied asylum in a country or countries prior to arriving to the United States, or traveled through a country or countries that were not part of major multilateral refugee treaties.
Caravans of migrants from Central American countries seeking asylum began moving toward the United States through Mexico last fall.
Trump has called the surge of arrivals a crisis and declared a national emergency in February to secure funds for constructing a border wall.