Four days before the end of the Trump presidency, a White House aide peered into the Oval Office and was startled, if not exactly surprised, to see all of the president's personal photos still arrayed behind the Resolute Desk as if nothing had changed — guaranteeing that the final hours would be a frantic dash mirroring the prior four years.

In the area known as the outer Oval Office, boxes had been brought in to pack up desks used by President Donald Trump's assistant and personal aides. But documents were strewed about, and the boxes stood nearly empty. The table in Trump's private dining room off the Oval Office was stacked high with papers until the end, as it had been for his entire term.

Upstairs in the White House residence, there were, however, a few signs that Trump had finally realized his time was up. Papers he had accumulated in his last several months in office had been dropped into boxes, roughly two dozen of them, and not sent to the National Archives. Aides had even retrieved letters from North Korean leader Kim Jong Un and given them to Trump in the final weeks, according to notes described to The New York Times.

Where all of that material ended up is not clear. What is plain, though, is that Trump's haphazard handling of government documents — a chronic problem — contributed to the chaos he created after he refused to accept his loss in November 2020, unleashed a mob on Congress and set the stage for his second impeachment. His unwillingness to let go of power, including refusing to return government documents collected while he was in office, has led to a potentially damaging, and entirely avoidable, legal battle that threatens to engulf the former president and some of his aides.

Although the White House counsel's office had told Mark Meadows, Trump's last chief of staff, that the roughly two dozen boxes' worth of material in the residence needed to be turned over to the archives, at least some of those boxes, including those with the Kim letters and some documents marked highly classified, were shipped to Florida. There they were stored at various points over the past 19 months in different locations inside Mar-a-Lago, Trump's members-only club, home and office, according to several people briefed on the events.

Those actions, along with Trump's protracted refusal to return the documents in Florida to the National Archives, prompted the Justice Department to review the matter early this year. This month, prosecutors obtained a warrant to search Mar-a-Lago for remaining materials, including some related to sensitive national security matters. The investigation is active and expanding, according to recent court filings, as prosecutors look into potentially serious violations of the Espionage Act and obstruction of justice.

Many questions about the mishandling of the documents lead to Trump, who often treated the presidency as a private business. But people in his orbit also highlight the role of Meadows, who oversaw what there was of a presidential transition. Meadows assured aides that the harried packing up of the White House would follow requirements about the preservation of documents, and he said he would make efforts to ensure that the administration complied with the Presidential Records Act, according to people familiar with those conversations.

But as the clock ticked down, Trump focused on pushing through last-minute pardons and largely ignored the transition he had tried to forestall.

A spokesperson for Trump did not respond to a request for comment. Trump has denounced the FBI search of Mar-a-Lago as a "witch hunt." His office has said he had a "standing order" that materials removed from the Oval Office and taken to the White House residence were deemed to be declassified the moment he removed them, although none of the three potential crimes cited in the FBI search warrant depend on whether removed documents are classified.

A lawyer for Meadows declined to comment.

Flouting records rules

In his final speech as president, Trump declared, "We were not a regular administration."

His statement was indisputably accurate. From his first hours in office, Trump had always taken a proprietary view of the presidency, describing government documents and other property — even his staff — as his own personal possessions. "They're mine" is how he often put it, former aides said.

But that was not the case. Under the Presidential Records Act, the law that strictly governs the handling of records generated in the Oval Office, every document belonged to taxpayers. Whether the materials were national security briefings, reams of unclassified documents automatically uploaded to a secure server in Pennsylvania or notes that Trump routinely ripped up or flushed down the toilet — all were government property to be assessed and, in most cases, transferred as part of the nation's history to the National Archives.

Trump's lawyers and aides were well versed in the records act, even if Trump routinely flouted it. Donald McGahn, Trump's first White House counsel, instituted a protocol for the proper handling of materials and gave presentations on the law to staff members, former officials said. After the 2020 election, White House officials held conversations about the fact that someone needed to retrieve documents that Trump had accumulated in the residence over many months, according to former officials.

By the end of the administration, White House counsel Pat Cipollone and his deputy, Patrick Philbin, were keenly aware that Trump's handling of documents was a potential problem, according to people in their orbit.

But it is unclear how much bandwidth either man had to deal with the issue. Trump was on contentious terms with Cipollone after the election, and often berated the lawyer for objecting to his attempts to subvert Joe Biden's victory, according to former officials.

Adding to the disarray was the absence of White House staff secretary Derek Lyons, who managed paperwork inside the executive complex but had stepped down Dec. 18, 2020. That left Meadows, a former House member with no significant executive experience before joining Trump's staff, responsible for overseeing a transition process the president wanted no part of.

Meadows' immediate predecessors in that role — President Barack Obama's last chief of staff, Denis McDonough, and President George W. Bush's final chief of staff, Joshua Bolten — had created teams to scrub West Wing offices of anything that belonged to the archives and made the stewardship of government records a priority.

It is unclear whether Meadows took the same measures, former aides said. But in the administration's final weeks, the White House emailed all of its offices detailed instructions about returning documents and cleaning out their spaces. Meadows followed up on those notes and encouraged offices to comply, according to a person familiar with those conversations.

Meadows also assured White House staff members that he would talk to Trump about securing records, including ones stashed in the residence, according to two people with knowledge of the situation.

Regardless of whether Meadows followed through on those promises, by early 2021, after Trump had left the White House, officials with the archives realized they were missing significant material.

They reached out to, among others, Scott Gast, who had been a lawyer in the White House counsel's office under Trump, and Philbin. The two men, along with Meadows and four other Trump officials, had been appointed by Trump on his last full day in office to work with the National Archives.

The archivists were particularly insistent about getting back the missing correspondence from the North Korean leader and a letter left on the Resolute Desk for Trump by Obama, both of significant historical value.

Archives officials also asked Gast and Philbin about the roughly two dozen boxes that had been in the residence during the Trump administration's final days. Philbin responded that he would work to get them in the hands of the archives and reached out to Meadows, who said he would help make it happen, according to former officials.

But archives officials did not get what they wanted until they traveled to Mar-a-Lago and retrieved 15 boxes of material this past January. Subsequently, archives officials told Trump's team that they had identified social media records that had not been preserved, and that they had learned White House staff members had not preserved official business they had conducted on their personal electronic messaging accounts.

They referred the matter to the Justice Department. In the spring, Philbin and Gast were questioned by the FBI about the boxes; Cipollone was also interviewed at some point. A grand jury was formed.

In June, one of Trump's lawyers signed a statement asserting that all relevant documents with classified markings from the boxes that had been requested — by then they were stored in a basement area at Mar-a-Lago — had been returned. The Justice Department would later file a detailed affidavit to a federal judge in Florida, revealing that the department believed possible crimes had been committed, precipitating the search Aug. 8 at the club.

Declassifying FBI materials

One of the few robust discussions about government documents at the end of the Trump administration focused on Crossfire Hurricane, the FBI investigation into whether the Trump campaign conspired with Russian officials. While that inquiry, which began in 2016, did not ultimately accuse Trump of criminal behavior, he remained obsessed with it throughout his term.

In Trump's last weeks in office, Meadows, with the president's blessing, prodded federal law enforcement agencies to declassify a binder of Crossfire Hurricane materials that included unreleased information about the FBI's investigative steps and text messages between two former top FBI officials, Peter Strzok and Lisa Page, who had sharply criticized Trump in their private communications during the 2016 election.

The FBI worried that releasing more information could compromise the bureau, according to people familiar with the debate. Meadows dismissed those arguments, saying that Trump wanted the information declassified and disseminated, they said.

Three days before Trump's last day in office, the White House and the FBI settled on a set of redactions, and Trump declassified the rest of the binder. Meadows intended to give the binder to at least one conservative journalist, according to multiple people familiar with his plan. But he reversed course after Justice Department officials pointed out that disseminating the messages between Strzok and Page could run afoul of privacy law, opening officials up to suits.

None of those documents, or any other materials pertaining to the Russia investigation, were believed to be in the cache of documents recovered by the FBI during the search of Mar-a-Lago, according to a person with knowledge of the situation.

Trump's final hours in office were in large part consumed by pardons. On the evening of Jan. 19, 2021, he pardoned Steve Bannon, his former chief strategist who had been indicted by federal prosecutors in New York for defrauding Trump's supporters.

The next morning, during his last minutes in office, he pardoned Al Pirro, the former husband of Fox News host Jeanine Pirro, who in 2000 had been convicted of tax evasion and conspiracy and sentenced to 29 months in prison.

Amid the pardons, many or all of the boxes in Trump's residence were shipped off — it is not clear precisely when or by what means — to Mar-a-Lago.

Letter for Biden

If Trump or Meadows needed a paradigm for the appropriate handling of government documents, they needed to look no further than Vice President Mike Pence's office.

Two of Pence's senior aides — Marc Short, his chief of staff, and Greg Jacob, his counsel — oversaw the indexing and boxing up of all of his government papers, according to three former officials with knowledge of the work.

Their goal: ensuring that Pence left office without a single paper that did not belong to him, one of the officials said.

That was in line with the record-keeping actions of the Obama administration, a process that was overseen by Dana Remus. She returned to the White House at 10 a.m. on Biden's Inauguration Day to meet Cipollone in her new capacity as the incoming president's counsel.

The meeting was short, and it set a pattern of amiable conversations between the two lawyers over the next year, according to people familiar with their interactions.

There were no comparable interactions between Meadows and Ron Klain, Biden's incoming White House chief of staff.

After weeks of rebuffing Klain's invitations to meet in person, Meadows told Klain to come to his big corner office — soon to be Klain's office — at 10 a.m. on Inauguration Day, after Trump was set to depart. When Klain arrived, no one was inside. Klain waited until someone came to get him, saying that Meadows was in the basement, in the Situation Room. They finally met at 10:45 a.m.

"I'm sorry this meeting is late. I only have a few minutes to meet with you," Meadows said, explaining that Trump had departed late for his final trip to Joint Base Andrews, according to a person with knowledge of the situation.

That afternoon, Biden arrived in the Oval Office and found a letter waiting for him in a drawer from Trump. It was two large pages, with Trump's distinctive handwriting visible to an aide watching Biden read it. The new president remarked that Trump had been more gracious in the letter than he had anticipated.

It was one of Biden's first records that will have to be turned over to the archives.