WASHINGTON — A federal judge ruled Wednesday that President Donald Trump broke the law when he fired members of an independent civil liberties watchdog without cause in January, ordering the reinstatement of those challenging their removals in court.

In a 71-page opinion, Judge Reggie B. Walton of U.S. District Court for the District of Columbia said Trump’s dismissal of Democratic-selected members to the five-person Privacy and Civil Liberties Oversight Board was illegal.

Lawmakers, the judge wrote, clearly intended to shield board members from arbitrary removal by a president before their terms were up. He noted that Congress created the bipartisan panel to oversee government counterterrorism actions and policies on the recommendation of the commission that investigated the 9/11 terrorist attacks.

“That responsibility is incompatible with at-will removal by the president, because such unfettered authority would make the board and its members beholden to the very authority it is supposed to oversee,” wrote Walton.

— The Associated Press