But his efforts to undermine the investigation’s origins and its conclusions helped lead Mr. Trump into an impeachment inquiry. The inquiry focuses on whether Mr. Trump, with assistance from Mr. Giuliani, abused the presidency to pressure Ukraine to pursue investigations for his political benefit, including into whether Ukrainians played a role in spurring the inquiry of the special counsel, Robert S. Mueller III.

Federal prosecutors in Manhattan are now investigating whether Mr. Giuliani’s efforts in Ukraine may have run afoul of the Foreign Agents Registration Act, or FARA, The New York Times reported on Friday.

Mr. Giuliani has defended his work in Ukraine and said it did not require him to register under FARA.

Mr. Trump was not enamored with the negative publicity around Mr. Giuliani, people close to the president said, but he remains loyal because of his lawyer’s willingness to aggressively defend him during the special counsel’s inquiry.

It is not clear what was discussed at the lunch.

Image The presidential motorcade leaving the Trump National Golf Club in Sterling, Va., on Saturday. Credit... Cheriss May for The New York Times

The lunch is unlikely to end speculation over whether the president will ultimately consider Mr. Giuliani a liability. Another of Mr. Trump’s personal lawyers, Michael D. Cohen, met privately with the president in Florida in March 2018, a month before the F.B.I. searched his home, hotel room and office. Mr. Trump publicly embraced Mr. Cohen, until it became clear he might speak against the president.

A White House spokesman did not immediately respond to a request for comment.

Asked over text message about the significance of the lunch, Mr. Giuliani directed a reporter to Mr. Trump’s show of support on Twitter.