A court of appeals has reversed a judge's appointment of a so-called "special master" who Donald Trump wanted to review documents seized by the FBI from his Florida home.
It's a major blow for the former US president because it means all of the seized records can now be used in an ongoing criminal investigation against him.
Let's take a look at what has played out and how it could impact the US Justice Department's investigation into the retention of top-secret government information.
What is a special master?
A special master is someone (usually an attorney, but not always) who is appointed in a highly sensitive case to go through seized materials and make sure that investigators don't review privileged information.
The American Bar Association, which represents legal professionals in the country, says the role of a special master involves making sure that the court order is being followed.
"Special masters often accompany peace officers in searches for documentary evidence in the possession of or under the control of attorneys, physicians, psychotherapists and clergy," the association said.
How did Trump get approval for a special master?
FBI agents carried out a court-approved search of Mr Trump's Mar-a-Lago estate in Florida on August 8.
Those agents seized more than 10,000 records, including about 100 marked as classified.
Two weeks later, Mr Trump filed a lawsuit requesting a special master be assigned to examine the documents.
The request went to US District Judge Aileen Cannon, who was nominated by Mr Trump himself when he was in office.
In September, Judge Cannon named Raymond Dearie, another federal judge, to act as special master and review the records to decide if some should be kept from investigators.
Judge Cannon also prevented prosecutors from using the documents taken in the search as part of their criminal investigation until the conclusion of Judge Dearie's review, although a separate 11th Circuit panel later gave the government access to the materials marked as classified.
Mr Trump's lawyers asked Judge Dearie to find that some of the documents met the definition of "personal" papers that should be kept private, or were protected by executive privilege, which allows presidents to keep certain communications secret.
The lawyers argued that Judge Dearie designated certain records as Mr Trump's personal papers. This claim was disputed by the Justice Department, which claimed that the use of a special master had delayed its criminal investigation.
How did Trump lose his special master?
The US Justice Department challenged Judge Cannon's decision to name a special master, and the Atlanta-based 11th Circuit US Court of Appeals ruled in favour of that challenge on Thursday.
The panel of judges said Judge Cannon didn't have the authority to grant Mr Trump's request for a special master.
It also overturned her decision to bar investigators from accessing most of the records pending Judge Dearie's review and threw out Mr Trump's suit.
The ruling was a unanimous decision from a panel of three Republican judges, including two who were selected by Mr Trump when he was president.
The court said that while a search warrant for a former president's property was "extraordinary", it did not give "the judiciary licence to interfere in an ongoing investigation".
It also said Mr Trump's team did not prove there was a "callous disregard" for his constitutional rights in the search of his property, which is one of the few reasons a court can intervene in an ongoing investigation.
"The law is clear. We cannot write a rule that allows any subject of a search warrant to block government investigations after the execution of the warrant," the judges wrote. "Nor can we write a rule that allows only former presidents to do so.
"Either approach," they added, "would be a radical reordering of our caselaw limiting the federal courts' involvement in criminal investigations. And both would violate bedrock separation-of-powers limitations."
The panel consisted of Judge William Pryor, appointed by former Republican president George W. Bush, as well as Mr Trump's appointees Judge Andrew Brasher and Judge Britt Grant.
What happens next?
Mr Trump is likely to take the case to the conservative-majority US Supreme Court, in order to appeal the decision to cancel the appointment of a special master.
The 11th Circuit court said its order would not take effect for seven days, during which Mr Trump could seek to challenge it.
A spokesperson for Mr Trump told the Reuters news agency that the court's decision was "purely procedural and based only on jurisdiction", and claimed it did not address the merits of the case.
"President Donald J. Trump will continue to fight against the weaponized Department of 'Justice', while standing for America and Americans," the spokesperson wrote.
US Justice Department officials reportedly learned they had won the case from reporters who were attending a holiday party with them in Washington.
The appeals court decision is likely to speed up the department's investigation by cutting short the outside review of the records seized by the FBI.
What is the Justice Department investigation looking into?
The federal criminal investigation into Mr Trump is considering whether he violated a 1917 law called the Espionage Act, which makes it a crime to release information harmful to national security.
Investigators also are looking into potential unlawful obstruction of their probe.
US Attorney General Merrick Garland last month appointed Jack Smith, a veteran public corruption prosecutor, to serve as special counsel overseeing the investigation.
It remains unclear how much longer the investigation will last or who, if anyone, might be charged.
However, the probe has shown signs of intensifying, with investigators questioning multiple associates of Mr Trump about the seized documents.
Last week the US Supreme Court cleared the release of Mr Trump's tax returns to a separate investigation by a congressional committee. The decision came about a week after Mr Trump announced he was running for president again in 2024.
ABC/wires