The exchanges escalated the public war that Mr. Trump has waged for more than a year on the Justice Department, training most of his fire on the special counsel investigation. Mr. Sessions’s response, his most forceful public pushback yet on Mr. Trump, showed the treacherous political terrain he is navigating: appointed by a president who has made apparent that he views law enforcement as loyal protectors but overseeing a Justice Department that views independence from political pressure as essential to the rule of law.

Mr. Sessions’ pushback came on a day of potentially damaging revelations for the president about the special counsel and Cohen inquiries. A longtime friend and the publisher of The National Enquirer, David J. Pecker, was given immunity to detail Mr. Cohen’s crimes and Mr. Trump’s role, a person familiar with the investigation confirmed. Mr. Trump’s lawyers also revealed that they warned him against even considering pardons for Mr. Manafort or other former aides, at least for now, opening Mr. Trump to accusations of tampering.

Republicans on Capitol Hill stood firm behind Mr. Sessions, who spent two decades as a senator, publicly cautioning Mr. Trump against firing him. They cited a packed calendar and a lack of confirmable replacements for a closely divided Senate where Democrats are watching vigilantly for any moves by the president that could undermine the Russia investigation.

“We don’t have time, nor is there a likely candidate who could get confirmed, in my view, under the current circumstances,” said Senator John Cornyn of Texas, the chamber’s No. 2 Republican. Senator Susan Collins of Maine, a key Republican swing vote, warned that removing Mr. Sessions because of his recusal from the Russia investigation “certainly would not be a wise move.” A spokesman for the majority leader, Senator Mitch McConnell of Kentucky, said he was not aware of any change in the leader’s support for Mr. Sessions.

But there were signs of softening, too, mainly from Senator Charles E. Grassley, Republican of Iowa and the head of the Judiciary Committee. Mr. Grassley has warred with Mr. Sessions over one of his top policy priorities, a comprehensive bipartisan criminal justice overhaul also championed by the president’s son-in-law and senior adviser, Jared Kushner. Mr. Grassley has said he believes that Mr. Sessions has led opposition within the administration to the legislative package.

During Thursday’s meeting at the White House, the president held off on backing the proposal at least until after November’s midterm elections, concluding that an endorsement now carried too much political risk, according to a senior White House official who was not authorized to disclose the private discussions and spoke on the condition of anonymity.