Soon after Deputy Attorney General Rod J. Rosenstein suggested using a wiretap to record President Trump’s communications, then-acting FBI director Andrew McCabe went to the bureau’s top lawyer seeking advice on what he had just heard.

Rosenstein, McCabe told the lawyer, wanted to furtively record the president to help explore whether Trump had obstructed justice. How, McCabe asked, should the FBI respond to the outlandish proposition?

The lawyer, James Baker, dismissed the idea, according to people familiar with the episode who described it to The Washington Post on the condition of anonymity. But importantly, Baker told congressional investigators last week that the deputy attorney general’s suggestion was presented to him by senior FBI officials as being serious — raising questions about Rosenstein’s assertions to the contrary, the people said.

This week, Rosenstein is scheduled to talk to congressional investigators about the 2017 episode, which nearly cost him his job after it was revealed in news accounts last month. The high-stakes interview with some of the president’s closest Republican allies could again put the deputy attorney general in the hot seat, especially if those lawmakers leave the interview unconvinced of Rosenstein’s testimony and relay their concerns to the president.

President Trump said Oct. 8 that he had a "really nice talk" with Deputy Attorney General Rod Rosenstein, who oversees the Mueller investigation.

His testimony also could give Trump supporters more ammunition to criticize the special counsel probe of Russian interference in the 2016 presidential election, an investigation Rosenstein supervises. Negotiations were ongoing Tuesday night about the time and parameters of his Thursday interview. Representatives for Baker and the Justice Department declined to comment.

“Really, we want to give the deputy attorney general the chance to clarify what was said and what was not said,” said Rep. Mark Meadows (R-N.C.), a Trump ally who has in the past been critical of Rosenstein.

Baker was not at the controversial meeting where Rosenstein broached the idea of a wiretap; his account to Congress, first reported by the Hill and Fox News, reflected what was relayed to him by other FBI officials with direct knowledge of the discussion.

According to Democratic aides familiar with Baker’s testimony last week, Baker could not recall which senior FBI official — McCabe or lawyer Lisa Page, who was at the Rosenstein meeting — recounted the substance of what was said to him. One of the aides said that while Baker characterized Rosenstein’s concern as “very serious,” it did not appear that Baker thought Rosenstein’s proposal was “an official one.”

According to a second Democratic aide, Baker said the proposal to wear a wire was dismissed by senior FBI and Justice Department officials “within a couple of days.”

McCabe memorialized the conversation in a memo, which also alleged that Rosenstein suggested using a constitutional amendment to try to remove Trump from office. The former acting FBI director has told people that Rosenstein suggested using a wiretap on multiple occasions. McCabe’s account of the proposed wiretap is supported by Page and notes she kept. Another person at the meeting, though, has said he did not take Rosenstein to be making a serious suggestion.

At the time of the meeting, tensions were running high between Rosenstein and McCabe, and according to participants in the meeting, it was clear that both men were on edge.

Justice Department officials at the meeting expressed concern that McCabe might have to recuse himself from the Russia probe, in part because of statements he had made at a congressional hearing after Trump fired FBI Director James B. Comey in May 2017, according to people present.

Days earlier, McCabe said of Comey, “I have the highest respect for his considerable abilities and his integrity, and it has been the greatest privilege and honor in my professional life to work with him.”

Justice officials were concerned that McCabe’s personal feelings for Comey could be a basis for recusal, particularly given a fact that few people outside the room knew at the time: The FBI had opened an investigative file on the president almost immediately after Comey’s firing, people familiar with the matter said.

Some Justice Department officials were concerned that McCabe’s public comments, combined with the quick move to take the momentous step of investigating the president, could raise questions about whether the FBI was motivated by anger over the Comey firing to launch an investigation of Trump, according to people familiar with the discussion.

At the meeting, McCabe was resistant to any suggestion that he should recuse himself, according to people familiar with the matter.

There was another reason Rosenstein and McCabe were in a standoff at the time: Rosenstein had authored a memo criticizing Comey’s handling of the Hillary Clinton email investigation, and the president used that memo as justification to fire Comey. To McCabe and others at the FBI, Comey’s firing was seen as potentially criminal, and it was possible that Rosenstein had enabled it, according to people involved in the discussions at the time.

A spokeswoman for McCabe said, “Mr. McCabe has no comment about the Department’s most recent version of events.”

Trump has repeatedly lambasted McCabe in public and privately distrusts him. Advisers have also warned Trump — apparently successfully — that firing Rosenstein, who oversees Robert S. Mueller III’s Russia probe, could create problems for Republicans in close races in next month’s elections, and it might give the special counsel another reason to suspect the president of obstructing justice.

In the Trump administration, though, no one is ever truly ensconced in their job. Only weeks ago, Rosenstein traveled to the White House fully expecting to be fired over a New York Times report that, per McCabe’s account in his memos, he had proposed using a wiretap against Trump or ousting him using a constitutional amendment. So real was his belief that he would soon be fired that the Justice Department prepared a succession plan — only to scrap it just hours later so Rosenstein and the president could sit down face to face and discuss what had occurred.

Trump later postponed that meeting as controversy surrounded his Supreme Court nominee, and Justice Department officials came to believe that the crisis had passed.

On Air Force One on Monday, Rosenstein finally made the case to the president that McCabe was wrong to assert he had ever pursued a wiretap or had discussed using a congressional amendment to remove Trump from office.

Trump said after the meeting that he had no plans to remove Rosenstein from his post and that he expected Mueller to treat him “very fairly.”

“I didn’t know Rod before,” the president said. “I’ve gotten to know him, and I get along very well with him.”

Those who have observed Trump and Rosenstein together say that, in person, the two men are friendly — which is perhaps more than can be said for Trump and Attorney General Jeff Sessions, whose recusal from the special counsel probe ignited a fury in the president like no other.

“There was real respect between the two of them,” said a Justice Department official who observed interactions between Rosenstein and Trump.

Rudolph W. Giuliani, Trump’s lawyer, said in an interview with The Post that Rosenstein told Trump that his comment about wiretapping was sarcastic, and that the president never believed that the deputy attorney general had pondered using a constitutional amendment to remove him from office. Giuliani said the president sees the deputy attorney general more than he does Sessions — Rosenstein, for example, attended the installation of new Supreme Court Justice Brett M. Kavanaugh, while Sessions did not — and sees no reason to make immediate personnel moves at the Justice Department.

“I wouldn’t like to see a change like that before we have things solidified with Mueller,” Giuliani said.

Rosenstein, a Republican, has shown a remarkable knack for surviving shifting political winds throughout his career. A veteran federal prosecutor, he was nominated in 2007 to be a judge on the U.S. Court of Appeals for the 4th Circuit, but his nomination languished because he lacked the backing of Maryland’s two Democratic senators. Those same senators, though, were supportive when he remained the U.S. attorney in Maryland through Barack Obama’s presidency.

James Trusty, who worked with Rosenstein in the U.S. attorney’s office, said Rosenstein was not a political mastermind but rather impressed the senators through his work.

“For Rod, it’s not some magic spell that he puts on politicians,” Trusty said. “It’s just performance and being apolitical.”

Karoun Demirjian contributed to this report.