OAKLAND—The federal judge who is overseeing a pair of legal challenges to funding for border wall construction Wednesday called the Trump administration’s moves to invoke a statute that allows the military to transfer funds to pay for construction in cases of national emergency “an extraordinary invocation of this authority.”

U.S. District Judge Haywood Gilliam Jr. of the Northern District of California said during oral argument on dueling motions for summary judgment in the cases that “Congress has already expressed judgment as to the relative merit of this project” when it passed a budget last year that appropriated $1.375 billion in spending limited to barriers in the Rio Grande Valley border sector in Southern Texas. The same day President Donald Trump signed the appropriations bill, he declared a national emergency and announced his intention to pull in $8.1 billion in funding for border barriers—in part by reallocating funds from military construction projects under section 2808 of the U.S. Code.