A federal judge on Monday blocked an experimental Trump administration policy that requires asylum seekers to wait in Mexico while their cases make their way through the U.S. immigration court system, a major blow to President Trump’s efforts to stem the surge of crossings at the southern border.

U.S. District Court Judge Richard Seeborg in San Francisco enjoined the Migrant Protection Protocols (MPP) policy days after outgoing Homeland Security Secretary Kirstjen Nielsen pledged to expand the program. The policy began in January at the San Ysidro port of entry in California but has been extended to the Calexico entry and to the entry in El Paso, and Seeborg wrote that the approach would have been further extended if the court were not to step in.