Federal prosecutors investigating former President Donald J. Trump’s handling of classified material have a recording of Mr. Trump from 2021 discussing a sensitive military document he had kept after leaving the White House, two people briefed on the matter said.

In the recording, Mr. Trump suggested he knew the document was secret and had not declassified it, one person briefed on the matter said.

The existence of the recording could undermine Mr. Trump’s repeated claim that he had already declassified material that remained in his possession after he left office. Prosecutors are scrutinizing whether Mr. Trump obstructed efforts by federal officials to retrieve documents he took with him after leaving office and whether he violated laws governing the handling of classified material.

The existence of the recording was reported earlier by CNN.

The recording was made during a meeting Mr. Trump held in July 2021 with people helping his former chief of staff, Mark Meadows, write a memoir of his 10 months in the White House, according to the people briefed on the matter. The meeting was held at Mr. Trump’s club at Bedminster, N.J., where he spends summers.

Until now, the focus of the documents investigation has been largely on material Mr. Trump kept with him at Mar-a-Lago, his private club and residence in Florida, rather than in New Jersey.

Mr. Meadows did not attend the meeting, but at least two of Mr. Trump’s aides did. One, Margo Martin, routinely taped the interviews he gave for books being written about him that year.

On the recording, Mr. Trump began railing about his handpicked chairman of the Joint Chiefs of Staff, Gen. Mark A. Milley, who was described in media accounts at the time as having guarded against Mr. Trump’s striking Iran in the final days of the presidency, according to the people briefed on the matter.

Mr. Trump then began referencing a document that he had with him, saying that it had been compiled by General Milley and was related to attacking Iran, the people briefed on the matter said. Among other comments, he mentioned his classification abilities during the discussion, one person briefed on the matter said. Mr. Trump can be heard handling paper on the tape, though it is not clear whether it was the document in question.

The Justice Department obtained the recording in recent months, a potentially key piece in a mountain of evidence that prosecutors have amassed under the special counsel, Jack Smith, since he was appointed in November to oversee the federal investigations into Mr. Trump.

Ms. Martin was asked about the recording during a grand jury appearance, according to two of the people briefed on the matter.

In an interview with CNN on Wednesday night, James Trusty, a lawyer representing Mr. Trump in the case, indicated that the former president was taking the position that he had declassified the material he took with him upon leaving office.

“When he left for Mar-a-Lago with boxes of documents that other people packed for him that he brought, he was the commander in chief,” Mr. Trusty said. “There is no doubt that he has the constitutional authority as commander in chief to declassify.”

Mr. Trusty said officials could prove that Mr. Trump had declassified material. But when pressed on whether Mr. Trump had declassified the document in question at the Bedminster meeting, Mr. Trusty declined to say.

In total, the government has recovered more than 300 documents with classified markings from Mr. Trump since he left office. They include a first batch of documents returned in January of last year to the National Archives, another set provided by Mr. Trump’s aides to the Justice Department that June, material seized by the F.B.I. in the search of Mar-a-Lago in August and a handful found in additional searches late last year.

One set of documents found by the F.B.I. during the search had the highest level of classification, top secret/sensitive compartmented information.

Mr. Trump has long touted what he claimed was his ability to automatically declassify materials and has even said he could do so with his mind.

His allies have insisted he had a standing order to declassify material when he took it from the Oval Office to the White House residence, a claim that several former senior administration officials have suggested is nonsense. Members of his legal team have cautioned his aides not to lean too heavily on that argument as a defense in the documents case.

That claim was raised most vocally by Kash Patel, a close adviser to Mr. Trump who testified to a grand jury under an immunity deal forced on him by prosecutors.

The recording obtained by the special counsel’s office could help prosecutors undercut any argument by Mr. Trump that the documents he had taken from the White House upon leaving office were declassified. It could also assist them in making a case that Mr. Trump was aware that his abilities to possess — and to show off — classified materials were limited.

Moreover, one of the laws cited by the Justice Department in seeking the warrant used to search Mar-a-Lago last year, known as the Espionage Act, was enacted by Congress during World War I, decades before President Harry S. Truman issued an executive order creating the modern classification system for the executive branch.

As a result, the Espionage Act makes no reference to whether a document has been deemed classified. Instead, it makes it a crime to retain, without authorization, documents related to the national defense that could be used to harm the United States or aid a foreign adversary.

Investigators have been asking witnesses about General Milley in various interviews for several weeks, although they have generally left unclear what they were looking for.

Investigators have several if not all of the recordings of book interviews that Mr. Trump gave, according to two of the people familiar with the events.

In one interview, Mr. Trump said he had taken “nothing of great urgency” when asked if he had anything in his possession.

Mr. Trump has equivocated when asked if he ever showed any classified documents to people once he left the White House. At a CNN town hall event in May, he said, “Not really. I would have the right to. By the way, they were declassified after.”

Mr. Meadows, in his book, appeared to echo Mr. Trump’s claim about General Milley.

“The president recalls a four-page report typed up by Mark Milley himself,” the book said. “It contained the general’s own plan to attack Iran, deploying massive numbers of troops, something he urged President Trump to do more than once during his presidency. President Trump denied those requests every time.”

Yet according to a person familiar with the document in question, the report was not written by General Milley and appears to date to an earlier period in the Trump administration, when Gen. Joseph F. Dunford Jr. was the chairman of the Joint Chiefs of Staff and Jim Mattis was the defense secretary.

General Milley has been interviewed by investigators about the matter, according to one person briefed on the discussion.