Mr. Giuliani’s appearances infuriated others in Mr. Trump’s orbit, who had been kept in the dark about his plans. At the White House, many of the president’s associates were particularly angry over an odd swipe that Mr. Giuliani took at Jared Kushner, the president’s son-in-law and senior adviser.

“Jared is a fine man, you know that,” Mr. Giuliani said, before adding, “Men are disposable.”

What he meant by disposable is unclear, but Mr. Kushner’s friends in the West Wing were equally puzzled by Mr. Giuliani’s comments about Ivanka Trump, Mr. Kushner’s wife. Mr. Giuliani called her “a fine woman” and predicted that “the whole country” would turn on Robert S. Mueller III, the special prosecutor in the Russia investigation, if Mr. Mueller went after Ms. Trump.

“A fine woman like Ivanka?” he said. “Come on.”

A veteran of the no-holds-barred world of New York tabloids that Mr. Trump inhabited for decades, Mr. Giuliani was an early and vocal supporter of Mr. Trump’s presidential campaign — a potential entree back into the limelight of national politics after his failed 2008 bid for the White House.

During Mr. Trump’s campaign, he was a forceful critic of Hillary Clinton, a longtime political rival and Mr. Trump’s opponent in the 2016 presidential race, and indulged in some non-truth telling that was as puzzling as it was brazen.

For example, he suggested that Hillary Clinton had not visited ground zero in the immediate period after the 9/11 attacks, even when reporters covered their joint trips there and ample photographic evidence to the contrary instantly emerged.

Mr. Giuliani also said during the campaign that the F.B.I. gave him the inside track into investigations into Mrs. Clinton’s emails. His private security consulting firm often attracted scrutiny and dinged his chances at joining the Trump administration.