Attorney General William P. Barr went to Capitol Hill on Tuesday to deliver a briefing on the government’s expiring surveillance authorities, and he left with a hearty attaboy from Senate Republicans.

Less than two weeks after a dust-up over the sentencing of a Trump campaign associate prompted President Trump to publicly question the Justice Department — which in turn compelled Barr to warn that Trump’s intervention was making the attorney general’s job “impossible” — GOP lawmakers gave Barr a solid show of support in a private lunch meeting.

“Every sentence began with, ‘Keep up the good work,’ ” said Sen. Kevin Cramer (R-N.D.), recalling senators’ remarks at the lunch, which began with a round of applause for Barr.

Senate Majority Leader Mitch McConnell (R-Ky.) told reporters afterward that Barr “enjoys overwhelming support” in the Republican ranks: “We all think he is doing an outstanding job.”

The warm welcome comes after Barr’s unusual decision this month to overrule rank-and-file prosecutors in recommending a lighter sentence for Trump associate Roger Stone. Barr said he intervened independently, though Trump publicly pushed for a lighter sentence before the recommendation was officially revised.

Barr privately discussed leaving the Trump administration amid the uproar, and Republican senators fear the loss of an experienced hand at the wheel of the Justice Department — as well as the difficult prospect of possibly confirming a replacement in an election year.

They left the meeting expressing relief, on that count.

“He didn’t give any indication he’s going anywhere,” said Senate Majority Whip John Thune (R-S.D.). “I think the impression that our members have is that he’s here to stay, and that certainly would be welcome news to Senate Republicans.”

“I think there’s a great, deep appreciation that he’s the right guy for us,” said Sen. Lindsey O. Graham (R-S.C.), chairman of the Judiciary Committee, which would oversee confirmation of another nominee.

“A few people just said, ‘Thank you for your service — we hope you continue for a long time,’ ” Cramer said.

The widespread encouragement came as Trump continues to tweet about Justice Department criminal cases, in defiance of Barr’s wishes. Barely an hour after the lunch, Trump tweeted again about the Stone case, calling it a “Miscarriage of justice.”

Barr also finds himself in the middle of a thorny issue that has split Republican lawmakers — the pending expiration of key federal surveillance authorities.

Lawmakers have until March 15 to decide whether and how they wish to extend the statutes, including provisions that have been used to support the large-scale collection of Americans’ phone records.

The matter has been further complicated by revelations surrounding the federal investigation into an aide with Trump’s 2016 campaign — an inquiry that included warrants issued under the statute in question, the Foreign Intelligence Surveillance Act, or FISA — leading to calls from many Republicans to remake the warrant-seeking process as a part of the reauthorization.

Sen. Rand Paul (R-Ky.), among others, is pushing to take any future surveillance of political campaigns out of the secret foreign intelligence court entirely, among other changes to the existing law.

“The time is right. The iron is hot. This is the time we should do FISA reform,” Paul said Tuesday.

But Barr, according to multiple senators, said he was not pressing for any specific statutory change to address the alleged Trump-related warrant abuses, which were detailed in a December report from Michael E. Horowitz, the Justice Department inspector general. Instead, he indicated that he would pursue administrative changes to remake how secret warrants are obtained and supervised.

“Some internal reforms, I think, are consistent with what Horowitz was recommending, so I think that’s good,” Graham said. “That doesn’t mean we won’t act legislatively.”

Graham is planning to investigate the Trump probe further and signaled Tuesday that the project of rewriting the FISA statute could well extended beyond the March 15 deadline.

Thune said after the lunch that “it’s going to be pretty hard” for Congress to agree on any statutory changes before the deadline, suggesting a short-term extension might be inevitable. Congress voted to extend the prior Dec. 15, 2019, deadline last year with only weeks to spare.

“We’ll see,” Thune said. “Senator Graham’s already indicated a willingness to take a broader look at FISA and what some of those reforms might look like. And I think we want to give that a chance to happen.”

Paul said he “will do everything I can” to oppose the sort of blanket reauthorization that Barr is seeking — even if it is a short extension to buy time for a more ambitious bill.

“What happens is, it calms everyone down, and then the legislation never comes up,” Paul said. “I think right now, people are angry about it, and now is the time to actually do something about it. If it fades, it may never get fixed.”