Attorney General Jeff Sessions recently told the White House he might have to leave his job if President Trump fired his deputy, Rod J. Rosenstein, who oversees the investigation into Russian interference in the 2016 election, according to people familiar with the exchange.

Sessions made his position known in a phone call to White House counsel Donald McGahn last weekend, as Trump’s fury at Rosenstein peaked after the deputy attorney general approved the FBI’s raid April 9 on the president’s personal attorney Michael Cohen.

Sessions’s message to the White House, which has not previously been reported, underscores the political firestorm that Trump would invite should he attempt to remove the deputy attorney general. While Trump also has railed against Sessions at times, the protest resignation of an attorney general — which would be likely to incite other departures within the administration — would create a moment of profound crisis for the White House.

In the phone call with McGahn, Sessions wanted details of a meeting Trump and Rosenstein held at the White House on April 12, according to a person with knowledge of the call. Sessions expressed relief to learn that their meeting was largely cordial. Sessions said he would have had to consider leaving as the attorney general had Trump ousted Rosenstein, this person said.

Another person familiar with the exchange said Sessions did not intend to threaten the White House but rather wanted to convey the untenable position that Rosenstein’s firing would put him in.

A Justice Department spokeswoman declined to comment.

Rosenstein’s status remains uncertain, but the pressure he is facing seemed to subside after last week.

Last summer, when it appeared Trump was going to fire Sessions or pressure him to resign, Republican lawmakers and conservative advocacy groups rallied to Sessions’s side and warned the president not to move against him.

Trump had told senior officials last week that he was considering firing Rosenstein, who was confirmed by the Senate with overwhelming bipartisan support last year. Since then, alumni of the Justice Department have rallied to Rosenstein’s defense.

As of Friday afternoon, more than 800 former Justice Department employees had signed an open letter calling on Congress to “swiftly and forcefully respond to protect the founding principles of our Republic and the rule of law” if Trump were to fire the deputy attorney general, special counsel Robert S. Mueller III or other senior Justice Department officials. The group MoveOn.org has sought to organize nationwide protests if such an event were to occur.

Rosenstein, on behalf of the Justice Department, is set to argue a sentencing case, Chavez-Meza v. United States, before the Supreme Court on Monday. Appearing before the high court has long been a professional goal, people close to Rosenstein say.

A senior administration official said Sessions does not like the way Rosenstein has been treated by the president and had expressed such concerns for months. He has regularly sought guidance from the White House about Rosenstein’s standing with the president and asked about his interactions with Trump, this official said.

But Sessions has had little ability to do anything about it, given his own shaky standing with Trump for recusing himself from the Russia investigation, this official said. Trump has, at times, referred to Sessions as “Mr. Magoo” and Rosenstein as “Mr. Peepers,” a character from a 1950s sitcom, according to people with whom the president has spoken.

The relationship between Sessions and Rosenstein — and their staffs — has been strained at times over the first year of the Trump administration. But people familiar with Sessions’s thinking say that he has said several times that he would find it difficult to remain as attorney general if Trump fired for no good reason the veteran prosecutor in Baltimore whom Sessions chose to be his deputy. The two men, along with Solicitor General Noel Francisco, were spotted in February dining together at a restaurant near the Justice Department, generating some speculation that they were attempting a display of solidarity.

Rosenstein, the Justice Department’s No. 2 official, is tasked with running the day-to-day operations of the sprawling agency of 113,000 employees who work for the FBI; the Drug Enforcement Administration; the Bureau of Alcohol, Tobacco, Firearms and Explosives; the Bureau of Prisons; U.S. attorneys offices; and Main Justice, the agency’s headquarters. But from the time he was confirmed in May of last year, the investigation into possible coordination during the 2016 presidential campaign between Trump associates and agents of the Russian government has overshadowed everything he has done.

James M. Trusty, a partner at Ifrah Law and a friend of Rosenstein’s, said the deputy attorney general “went into the job with a pretty fatalistic view,” but he “probably didn’t know it was going to be this much of a storm.”

“I remember him joking at his going-away party that nine months was the average tenure for the deputy attorney general,” Trusty said.

A wall of photographs outside Rosenstein’s fourth-floor office at the Justice Department illustrates the high-stress and political nature of the deputy attorney general’s position. President Barack Obama’s first deputy attorney general, David Ogden, stepped down from the job after less than a year. One of President Bill Clinton’s deputy attorneys general, Philip B. Heymann, lasted 10 months.

Trusty, who said he had spoken with Rosenstein about three weeks ago, said Rosenstein had kept his views on the situation largely private and had not sought surrogates or anyone else to press his case.

“I think he tends to view things in a very long-range way, kind of a this-too-shall-pass philosophy about the slings and arrows that will come at you,” Trusty said.

A month after Rosenstein became deputy attorney general, he was criticized for his role in the firing of FBI Director James B. Comey. Rosenstein wrote a critical memo lambasting Comey for his handling of the Hillary Clinton email investigation, and the White House later used the document as a pretext to remove the FBI director. After a few days, though, Trump said he was thinking about the Russia investigation when he fired Comey. Comey has said in recent days he believed Rosenstein “acted dishonorably” and could not be trusted.

At that point, Rosenstein was overseeing the Russia investigation because Sessions had recused himself. On May 17, about a week after the Comey firing, Rosenstein announced that he had appointed Mueller as special counsel to conduct the Russia investigation.

Rosenstein took the action without first consulting Sessions and notified him when he was at the White House meeting with Trump. The decision took Trump by surprise and greatly angered him.

A person close to the White House and the Justice Department said Sessions has “vacillated, I think, from being concerned about the deputy leaving or being fired and recognizing that Rosenstein has not been a friend of either him or the department.”

During the past year, Rosenstein has been involved in several policy issues in the Justice Department, as well as complex prosecutions involving cybercrimes and the first charges against Chinese-based fentanyl manufacturers and distributors.

But Russia continues to consume his days. This week, two of Trump’s top legislative allies and leading members of the conservative House Freedom Caucus met with Rosenstein and pressed him for more documents about the conduct of law enforcement officials involved in the Russia probe. They warned him that he could face impeachment proceedings or an effort to hold him in contempt of Congress if he did not satisfy Republican demands for more documents.