A US judge will allow a congressional committee investigating the Capitol riot to access some of ex-President Donald Trump’s White House records.
Trump had tried to invoke executive privilege, under which presidential documents can be kept secret.
The aim of the inquiry is to find out if Trump had prior knowledge of the riot.
Trump supporters stormed the Capitol building on 6 January as Congress was certifying President Joe Biden’s election victory.
With Trump still refusing to acknowledge losing the election last year, claiming – without evidence – that it had been rigged.
The inquiry is being conducted by a committee set up by the House of Representatives which is dominated by President Biden’s Democrats.
The panel wants to go through phone records, visitor logs and other White House documents that could shed some light on the events leading up to the attack on Congress.
It has issued summonses to several Trump aides to testify before the lawmakers.
Mr Trump – a Republican – had argued his White House communications were protected and as such should not be released.
But US District Judge Tanya Chutkan ruled that the National Archives, the federal agency that holds the records, should comply with the panel’s request.
In a 39-page ruling, Judge Chutkan said that Congress had the right to see the documents, particularly as the current president had agreed.
Trump “does not acknowledge the deference owed to the incumbent president’s judgment. His position that he may override the express will of the executive branch appears to be premised on the notion that his executive power ‘exists in perpetuity,'” the judge wrote. “But presidents are not kings, and plaintiff is not president.”
However, it is unlikely the records will be accessible in the near future.
The legal battle is likely to wind up at the Supreme Court.
A spokesman for Trump, said the case was likely to be appealed.
Taylor Budowich said Trump was committed to defending the right of US presidents to assert executive privilege and “will be seeing this process through”.
But Bennie Thompson, the Mississippi Democrat who is chairman of the committee, called the lawsuit “little more than an attempt to delay and obstruct our investigation.”
Sixteen of Trump’s closest aides have been subpoenaed in the past two days.
They include Kayleigh McEnany, the White House press secretary, Stephen Miller, who was Trump’s senior adviser, Bill Stepien, campaign manager, Mark Meadows, former White House chief of staff, and Michael Flynn, former national security adviser.
The panel has already subpoenaed Dan Scavino, former deputy chief of staff, and Steve Bannon, a former Trump strategist.
Bannon refused to comply with the subpoena and was charged with contempt of Congress.
Trump was impeached by the lower house of Congress, following the Capitol riot, but cleared by the then Republican-dominated upper house, the Senate, of inciting an insurrection.
More than 670 people have been arrested for the invasion of the Capitol complex.