A Southern California judge, once disparaged by President Donald Trump, ruled in his favor Tuesday in a lawsuit challenging Department of Homeland Security decisions related to Trump’s plans for a wall along the southern border.

The state of California and several environmental advocacy groups brought three lawsuits last year against DHS, which were consolidated into one before U.S. District Judge Gonzalo Curiel of the Southern District of California. The lawsuits challenged waivers signed by former DHS Secretaries John Kelly and Elaine Duke, pursuant to the 1996 Illegal Immigration Reform and Immigrant Responsibility Act, to allow construction of the wall.