President Trump bristled at accounts on Saturday that his personal lawyer, Rudolph W. Giuliani, had become a focus of a widening criminal investigation into his dealings in Ukraine, insisting that Mr. Giuliani was a “crime buster” and target of a “witch hunt.”

On Twitter, Mr. Trump referred to Mr. Giuliani’s background as the former New York City mayor and a one-time federal prosecutor.

“So now they are after the legendary ‘crime buster’ and greatest Mayor in the history of NYC, Rudy Giuliani,” Mr. Trump wrote. “He may seem a little rough around the edges sometimes, but he is also a great guy and wonderful lawyer. Such a one sided Witch Hunt going on in USA. Deep State. Shameful!”

On Friday, Mr. Trump was far less emphatic when asked if Mr. Giuliani was still his personal lawyer.