WASHINGTON — Deputy Attorney General Rod Rosenstein discussed secretly recording President Donald Trump last year amid law enforcement concerns about chaos in the White House, according to people familiar with exchanges at the time.

But one person who was present said Rosenstein was being sarcastic.

Rosenstein’s comments were first reported by The New York Times, which also said that he raised the idea of using the 25th Amendment to remove Trump as unfit for office.

The reports create even greater uncertainty for Rosenstein in his position at a time when Trump has lambasted Justice Department leadership and publicly humiliated the deputy attorney general and Attorney General Jeff Sessions.

More broadly, it’s the latest revelation that could affect Robert Mueller, the special counsel investigating possible coordination between Russia and Trump’s presidential campaign in 2016. Sessions recused himself from that issue soon after he took office, to Trump’s dismay, and Rosenstein then appointed Mueller. Trump has resisted calls from conservative commentators to fire Sessions and Rosenstein and appoint someone who would ride herd more closely on Mueller or dismiss him.

The reported conversation about possibly secretly recording the president took place at a tense May 2017 meeting following Trump’s firing of FBI Director James Comey, a decision that upset many rank-and-file bureau agents.

Among the participants at the meeting was Andrew McCabe, the FBI official who was temporarily elevated to director after Comey’s firing and who documented conversations with senior officials, including Rosenstein, in memos that have been provided to Mueller as part of his Trump-Russia investigation.

The interactions lay bare the conflicts within the FBI and Justice Department early in the Trump administration after Rosenstein, just weeks into his job, wrote a memo critical of Comey’s handling of the Hillary Clinton email server investigation that the White House used as justification for firing the FBI director.

Friday’s news reports threatened to cloud Rosenstein’s fate at the Justice Department, with some conservatives calling for him to be fired immediately. Any dismissal could affect Mueller’s Russia probe, given that Rosenstein oversees Mueller’s work.

Trump ignored questions shouted from reporters as he arrived for a rally Friday in Springfield, Mo. But he pledged at the rally to rid the Justice Department of its “lingering stench.”

It was difficult amid the conflicting accounts to discern the precise context for his comments and how they were intended. The Justice Department, for instance, released an email from one attendee who said Rosenstein’s “statement was sarcastic and was never discussed with any intention of recording a conversation with the president.”

Rosenstein called the Times story “inaccurate and factually incorrect.”

“I will not further comment on a story based on anonymous sources who are obviously biased against the department and are advancing their own personal agenda. But let me be clear about this: Based on my personal dealings with the president, there is no basis to invoke the 25th Amendment.”

One of the people briefed on the conversation, who spoke on condition of anonymity because of the confidential nature of the interaction, said it occurred during a moment of frustration between McCabe and Rosenstein. Rosenstein was rankled by the revelation that Comey had kept memos about his interactions with the president; McCabe wanted a more aggressive approach toward the White House, the person said.

At that point, Rosenstein said to McCabe something to the effect of, “What do you want, you want me to wear a wire?” according to the person. Rosenstein was then asked in the meeting if he was serious, and he said yes, but he did not mean for the wire comment to be taken seriously as a tactic to investigate the president, the person said.

The person also said that a memo from McCabe describes Rosenstein as referencing the 25th Amendment to the Constitution, which spells out that a president can be declared “unable to discharge the powers and duties of his office” upon a majority vote of the vice president and the Cabinet. But the person said notes from other attendees at the meeting, including former FBI lawyer Lisa Page, do not mention the 25th Amendment.

Rosenstein served as Maryland’s U.S. attorney for 12 years and was the longest-serving top federal prosecutor in the country when he was appointed deputy attorney general. He was was praised by leaders on both sides of the aisle.