WASHINGTON — President Trump had lunch on Saturday with Rudolph W. Giuliani amid revelations that prosecutors were investigating Mr. Giuliani for possible lobbying violations, and speculation that his position as the president’s personal lawyer was in jeopardy.
The lunch, at Mr. Trump’s golf course in Sterling, Va., was among several shows of the president’s support for Mr. Giuliani on Saturday. They seemed meant to tamp down questions about Mr. Giuliani’s status with a client famous for distancing himself from advisers when they encounter legal problems of their own.
Mr. Trump, during a Saturday night appearance on Fox News, called Mr. Giuliani “a great gentleman” and said he is still his lawyer. “I know nothing about him being under investigation. I can’t imagine it,” he told the host Jeanine Pirro.
Before the lunch, Mr. Giuliani and Mr. Trump spoke on the phone, according to two people familiar with the discussions. Also beforehand, Mr. Trump praised Mr. Giuliani on Twitter as a “legendary ‘crime buster’ and greatest Mayor in the history of NYC.”
Mr. Giuliani “may seem a little rough around the edges sometimes, but he is also a great guy and wonderful lawyer,” the president’s tweet continued.
And Mr. Trump dismissed the investigation into Mr. Giuliani as a “a one sided Witch Hunt” carried out by the “Deep State.”
The president echoed language he had used to minimize the special counsel’s investigation into whether he or his campaign worked with Russians who interfered in the 2016 election to try to help him win the presidency.
Mr. Giuliani, a former federal prosecutor and New York mayor, was retained last year to help defend the president in the special counsel’s investigation.
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.
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.
He said his relationship with Mr. Trump was “the same as ever,” but declined to answer additional questions, explaining he was watching the New York Yankees’ playoff baseball game against the Houston Astros.
The two people familiar with the discussions between Mr. Trump and Mr. Giuliani said they believed it would be difficult to prove that Mr. Giuliani violated FARA.
The law requires American citizens to disclose to the Justice Department any contacts with the government or media in the United States at the direction or request of foreign politicians or government officials, regardless of whether they paid for the representation.
Mr. Giuliani has acknowledged that he and two of his associates, who were arrested on campaign finance charges on Wednesday, worked with Ukrainian prosecutors to collect potentially damaging information about targets of Mr. Trump and his allies, including a former American ambassador to Ukraine and former Vice President Joseph R. Biden Jr. and his younger son, Hunter Biden.
Mr. Giuliani shared that material this year with American government officials and a Trump-friendly columnist in an effort to undermine the ambassador and other Trump targets.
But Mr. Giuliani said that he had undertaken that work on behalf of Mr. Trump, not the Ukrainian prosecutors. He said he had in fact turned down an offer to represent one of the prosecutors because it would have posed a conflict with his work for the president.
What concerns some of Mr. Trump’s advisers more than a possible FARA prosecution related to his Ukraine work is that Mr. Giuliani, who has been representing the president pro bono, is facing a contentious and potentially costly divorce from his third wife, Judith Nathan, and that he may have taken on clients overseas who could be problematic for him with prosecutors.
While Mr. Trump has been reluctant to separate from Mr. Giuliani, some of his advisers hope he will. They remain concerned about Mr. Giuliani’s public commentary about the president and the Ukraine issue.
Kenneth P. Vogel reported from Washington, and Maggie Haberman from New York. Annie Karni contributed reporting from Washington.