Former President Donald Trump received a subpoena this spring in search of documents that federal investigators believed he had failed to turn over earlier in the year, when he returned boxes of material he had improperly taken with him upon moving out of the White House, three people familiar with the matter said.

The existence of the subpoena helps to flesh out the sequence of events that led to the search of Trump's Florida home Monday by FBI agents seeking classified material they believed might still be there, even after efforts by the National Archives and the Justice Department to ensure that it had been returned.

The subpoena suggests that the Justice Department tried methods short of a search warrant to account for the material before taking the politically explosive step of sending FBI agents unannounced to Mar-a-Lago, Trump's home and members-only club.

Two people briefed on the classified documents that investigators believe remained at Mar-a-Lago indicated that they were so sensitive in nature, and related to national security, that the Justice Department had to act.

The subpoena was first disclosed by John Solomon, a conservative journalist who has also been designated by Trump as one of his representatives to the National Archives.

The existence of the subpoena is being used by allies of Trump to make a case that the former president and his team were cooperating with the Justice Department in identifying and returning the documents in question and that the search was unjustified.

The Justice Department declined to comment. Christina Bobb, a lawyer working for Trump, did not respond to messages. It is not clear what precise materials the subpoena sought or what documents Trump might have provided in response.

The subpoena factored into a visit that Jay Bratt, the Justice Department's top counterintelligence official, made with a small group of other federal officials to Mar-a-Lago weeks later, in early June, one of the people said.

The officials met with Trump's lawyer, Evan Corcoran. Trump, who likes to play host and has a long history of trying to charm officials inquiring about his practices, also made an appearance. During the visit, the officials examined a storage area where the former president had stowed material that had come with him from the White House.

A few days after the visit, Bratt emailed Corcoran and told him to further secure the remaining documents, which were kept in the storage area with a stronger padlock, one of the people said. The email was reported earlier by The Wall Street Journal.

Then, they subpoenaed surveillance footage from the club, which could have given officials a glimpse of who was coming in and out of the storage area, according to a person with knowledge of the matter. They received footage specifically from areas of the club where they believed the documents might have been stored, the person said.

During the same period, investigators were in contact with a number of Trump's aides who had some visibility into how he stored and moved documents around the White House and who still worked for him, three people familiar with the events said.

Among those whom investigators reached out to was Molly Michael, Trump's assistant in the outer Oval Office who also went to work for him at Mar-a-Lago, three people familiar with the outreach said.

Investigators have also reached out to Derek Lyons, the former White House staff secretary, whose last day was Dec. 18, 2020, and no longer works for Trump, with questions about the process for handling documents, according to a person familiar with the outreach.

Federal officials came to believe that Trump had not relinquished all the material that left the White House with him at the end of his term, according to three people familiar with the investigation.

Less than two months later, about two dozen FBI agents, intentionally not wearing the blue windbreakers emblazoned with the agency's logo usually worn during searches, appeared at Mar-a-Lago with a warrant.

The club was closed; Trump was in the New York area; the FBI startled a crew fixing a large fountain, a maid who was dusting and a handful of Secret Service agents who guard the complex.

The search warrant was broad, allowing the agents to investigate all areas of the club where classified materials might have been stored. They went through the basement, Trump's office and at least part of his residence at the club.

After hours of searching, they left with several boxes that were not filled to the brim and in some cases simply contained sealed envelopes of material that the agents took and were otherwise empty, one person familiar with the search said.

The person said that the FBI left behind a two-page manifest of what was taken.

Trump's team has declined to disclose the contents of the search warrant. A number of organizations, including The New York Times, are seeking in federal court to have it unsealed.

Some senior Republicans have been warned by allies of Trump not to continue to be aggressive in criticizing the Justice Department and the FBI over the matter because it is possible that more damaging information related to the search will become public.

When Trump left the White House after refusing to concede that he had lost the 2020 election and seeking frantically to stay in power, a number of boxes of material made their way from the West Wing to Florida.

In the boxes was a mash of papers, along with items like a raincoat and golf balls, according to people briefed on the contents. The National Archives tried for months after Trump left office to retrieve the material, engaging in lengthy discussions with his representatives to acquire what should have been properly stored by the archives under the Presidential Records Act.

When archivists recovered 15 boxes of material this year, they discovered several pages of classified material and referred the matter to the Justice Department. But officials later came to believe that additional classified material remained at Mar-a-Lago.

Some of Trump's advisers have maintained that they were trying all along to cooperate with federal officials and had kept an open line of communication.

But others familiar with federal officials' efforts to recover the documents have said that Trump resisted returning property that belonged to the government, despite being told that he needed to.

Some of Trump's informal advisers outside his direct employ have insisted to him that he can claim the documents are personal items and keep them.

This article originally appeared in the New York Times.