Some of those tweets from the president came just before the Justice Department reversed course on its sentencing recommendation for Roger Stone, a longtime Trump adviser and friend who was convicted on charges of obstruction of Congress and witness tampering.

Justice Department officials insisted that such a reversal was already in the works before Trump took to his Twitter account to criticize the initial sentencing recommendation of seven to nine years. U.S. District Court Judge Amy Berman Jackson sentenced Stone on Thursday to more than three years in prison.

If Barr resigns, it would put Senate Republicans in a difficult bind in an election year. Top GOP senators have warned Trump that a replacement likely could not be confirmed this year, and they have sought to make the case to the president that Barr is skillfully implementing his priorities at the Justice Department.

The source said Barr was invited and agreed to attend the lunch “weeks ago,” as Congress weighs action to extend a key provision of the Patriot Act that is set to expire on March 15. That provision, known as Section 215, allows for the bulk collection of metadata from Americans’ phone records.

Civil libertarians — including several Republican lawmakers — have long assailed the program as unconstitutional, while proponents like McConnell and Barr argue that it serves an important counterterrorism purpose.

Burgess Everett contributed to this report.