The Trump administration could be forced to re-examine its border wall plans and more actively engage with local, state and federal environmental agencies before construction begins, based on questions asked by a federal judge on Friday afternoon.

After two and half hours of arguments, U.S. District Court Judge Gonzalo Curiel said he wanted additional written briefs before making a decision — likely next week.

This case comes as President Trump and Congress continue negotiations over immigration reform -- a high-stakes political issue not addressed during the court hearing. If Curiel ultimately decides the Department of Homeland Security does not have authority to waive several dozen laws to expedite wall construction, then that could raise a question: Why would the Trump administration legalize 1.8 million DACA recipients in exchange for $28 billion in wall funding if that money could not be spent in a timely manner?

While Curiel said nothing to give a strong indication of which way he may ultimately rule, he did ask pointed questions about whether the feds gave state and local authorities short shrift in its border wall plans.

Curiel inquired about the level of congressionally mandated consultation Homeland Security solicited from the state of California and local entities about ways to mitigate environmental and other harms associated with wall construction.

Curiel seemed particularly bothered that DHS issued waivers in September to allow construction crews to ignore several dozen federal and state environmental laws months before reaching out to other stakeholders.

“When must it happen for waivers to be issued?” Curiel asked. DOJ lawyer Galen Thorp said Congress didn’t specify the exact timeline of the consultation – only that it needed to happen, even if after the waiver has been issued.

By the end of the hearing, the judge returned to the issue and asked each side for additional written briefs on the matter. Curiel expressed interest in issuing a ruling before Thursday, when new border construction in Calexico, California, is expected to start.

California argues the federal government is overreaching in its authority to construct any new fencing along the border. Congress allowed DHS to “expeditiously” construct up to 700 miles of double reinforced steel fencing, but that was back in 2006. The state argues that authority has expired and any new construction would require new congressional authorization.

“Congress wasn’t interested in a deferred maintenance plan,” said lawyer Michael Cayaban, representing the California attorney general.

Environmental groups, including the Center for Biological Diversity, the Sierra Club, Defenders of Wildlife and the Animal Legal Defense Fund, claim any new construction would damage sensitive habitat, and violate the Endangered Species Act and a dozen other state and federal environmental protections.

Lawyers for the administration say the federal government’s authority over border security is absolute and longstanding. Dating back to the Immigration Reform Act of 1996 and again in the Real ID Act of 2005 and the Secure Fence Act of 2006, Congress gave the executive branch the power to override state and environmental protections to protect national security and control illegal immigration at the border.