A U.S. federal judge on Monday rejected a lawsuit by Democrats in the House of Representatives that sought to block President Donald Trump’s plan to divert funds to help build a border wall.

District Court Judge Trevor McFadden of the District of Columbia ruled that the House lacked legal standing to sue Trump for using money to build a wall on the U.S.-Mexico border that was appropriated by Congress for other purposes.

“While the Constitution bestows upon Members of the House many powers, it does not grant them standing to hale the Executive Branch into court claiming a dilution of Congress’s legislative authority. The Court therefore lacks jurisdiction to hear the House’s claims and will deny its motion,” McFadden wrote.

House Democrats had argued diverting the funds violated the separation of powers doctrine laid out in the U.S. Constitution.

The Justice Department applauded the ruling.

“The court rightly ruled that the House of Representatives cannot ask the judiciary to take its side in political disputes and cannot use federal courts to accomplish through litigation what it cannot achieve using the tools the Constitution gives to Congress,” a department spokesman said in a statement.

A spokesman for House Speaker Nancy Pelosi said Democrats were reviewing the ruling and evaluating whether to appeal.

The ruling is in contrast to a decision on May 24 by U.S. Judge Haywood Gilliam Jr., who issued a preliminary injunction blocking the use of $1 billion in Defense Department funds out of a total of $6.7 billion Trump wants to divert for the border wall. Read more

Read also: Trump’s top associates look to Mueller report for backup against Democrats in court