A federal judge Monday dismissed a lawsuit brought by historians and watchdog groups to compel the White House to preserve records of President Trump’s calls and meetings with foreign leaders, saying that Congress would have to change presidential archiving laws to allow the courts to do so.

Federal courts have ruled that the Presidential Records Act is one of the rare statutes that judges cannot review, and that another law, the Federal Records Act, does not specify exactly how agency heads should preserve records, U.S. District Judge Amy Berman Jackson said in a 22-page opinion.

“The Court is bound by Circuit precedent to find that it lacks authority to oversee the President’s day-to-day compliance with the statutory provisions involved in this case,” Jackson wrote of the U.S. Court of the Appeals for the District of Columbia Circuit.

However, the judge added pointedly, “This opinion will not address, and should not be interpreted to endorse, the challenged practices; nor does it include any finding that the Executive Office is in compliance with its obligations.”

Jackson said that though those who brought the lawsuit allege Congress expressed “grave concerns” about the practices at issue, it is Congress that has the power to “revisit its decision to accord the executive such unfettered control or to clarify its intentions.”

The lawsuit was filed in May by three organizations — government watchdog group Citizens for Responsibility and Ethics in Washington (CREW), the National Security Archive at George Washington University, and the Society for Historians of American Foreign Relations (SHAFR). The groups alleged that the White House was failing to create and save records as required of Trump’s meetings and communications with foreign leaders, including Russian President Vladi­mir Putin and North Korean leader Kim Jong Un.

The lawsuit preceded Congress’s impeachment inquiry into the White House — which ended last week in a Senate acquittal — that was triggered by a July 25 phone call in which Trump asked his Ukrainian counterpart to investigate unsubstantiated corruption allegations against former vice president Joe Biden, a leading Democratic presidential candidate, and his son Hunter Biden.

The groups suing had asked unsuccessfully for an emergency ruling, citing allegations that the episode exposed record-keeping practices “specifically designed to conceal the president’s abuse of his power,” CREW said in a statement. The groups sought a court order to ensure records are not destroyed, misfiled or never created.

In a statement, CREW spokesman Jordan Libowitz said the watchdog was “disappointed to see today’s ruling” but is reviewing an appeal.

Thomas Blanton, director of the National Security Archive at George Washington University said it would “certainly appeal.”

“Congress assumed presidents would want to save their records. Even [Richard M. Nixon] saved the tapes,” Blanton said, referring to Oval Office audio recordings that helped expose the Watergate scandal. Lawmakers also must decide whether they will give archiving laws “teeth,” making them enforceable and subject to congressional oversight, he said.

The Justice Department had moved to dismiss the lawsuit, saying appeals courts have precluded courts from weighing in on presidents’ compliance with the archiving law.

Without conceding their arguments for dismissal, department lawyers in October promised the court that the White House would not destroy records of Trump’s calls and meetings with foreign leaders while the lawsuit was pending. Justice Department lawyers also said the government had “instructed relevant personnel to preserve the information” sought.

They include records of communications with foreign leaders, record-keeping policies and practices, White House or agency investigations into such matters and efforts to return, “claw back” or “lock down” such records.

The suing groups allege the White House and other executive branch officials have mismanaged records of politically sensitive Trump conversations. They cited reports that Trump has met several times with Putin with no note-takers present or official U.S. record created, and that Trump “confiscated” a State Department interpreter’s notes after another meeting. They also cited a Trump meeting with North Korean leader Kim Jong Un in Vietnam, where only two interpreters were present and no official record created.

The absence of records risks “real, incalculable harm” to national security and effective foreign policy by depriving policymakers and historians of a documentary record of actions taken under federal law, the groups argued.