A federal judge in Texas blocked the Trump administration from using military construction funds to pay for President Trump's wall along the U.S.-Mexico border, delivering a blow to the president as he seeks to fulfill the signature promise of his 2016 presidential campaign.

The ruling Tuesday by U.S. District Judge David Briones of the U.S. District Court for the Western District of Texas bars the Trump administration from using $3.6 billion authorized for military construction projects to pay for construction of the wall.

In September, Secretary of Defense Mark Esper authorized the reprogramming of the military construction funds, allowing that money to be used to build roughly 175 miles of border barriers. The move was expected to affect roughly 127 Pentagon projects.

Get Breaking News Delivered to Your Inbox

Mr. Trump declared a national emergency at the southern border in February, claiming there is a national security and humanitarian crisis. The declaration followed a record-setting 35-day government shutdown, which was the result of an impasse between the White House and Democrats over wall funding.

After Mr. Trump took unilateral action to secure funding for the wall by tapping into the Defense Department's coffers, the city of El Paso and the Border Network for Human Rights filed a lawsuit arguing the move was unlawful.

Briones' ruling only prohibits the Trump administration from using military construction funds for wall projects. The Supreme Court in July allowed the Trump administration to use $2.5 billion originally designated for the Defense Department's counter-narcotic efforts to build the wall. Congress also gave the president $1.375 billion for the wall.

Kristy Parker, counsel for Protect Democracy, a nonprofit that is representing the plaintiffs in the case, cheered the ruling from Briones.

"The president's emergency proclamation was a blatant attempt to grab power from Congress," she said in a statement. "Today's order affirms that the president is not a king and that our courts are willing to check him when he oversteps his bounds."

House Speaker Nancy Pelosi, a Democrat from California, also heralded the ruling as "a victory for the rule of law, our Constitution and our American democracy."

"Once again, the courts have resoundingly ruled against the President's attempt to negate our system of separation of powers, which is the genius of our Constitution, by assaulting Congress's exclusive constitutional power of the purse," she said in a statement. "Despite what the President may think, Article II does not mean that he can 'do whatever he wants.'"

The White House did not respond to a request for comment.