President Trump’s personal attorney, Rudolph W. Giuliani, has hired lawyers of his own to represent him, as federal prosecutors in New York probe his interactions with two men charged with campaign finance violations.

Giuliani announced the hires on Twitter on Wednesday, indicating that he will be represented by New York lawyers Robert Costello, Eric Creizman and Melissa Madrigal.

The hires marked a shift for the former New York mayor, who had until recently insisted he did not need a defense lawyer, even as scrutiny of his interactions with the men, Lev Parnas and Igor Fruman, has mounted.

Parnas and Fruman connected Giuliani to current and former Ukrainian officials as Giuliani sought damaging information about Democrats in Ukraine.

That project is at the heart of the impeachment inquiry into Trump, after the president pressed Ukraine’s president to work with Giuliani and launch investigations involving the 2016 election and former vice president Joe Biden.

Parnas and Fruman were arrested last month at Dulles International Airport and charged with conspiring to violate campaign finance laws by funneling foreign money to various state and federal candidates. They have pleaded not guilty.

Giuliani’s interactions with the two men are being investigated by federal prosecutors in New York, according to people familiar with the matter.

Giuliani’s decision to hire defense attorneys comes as a new lawyer for Parnas indicated earlier this week that the former Giuliani associate may be willing to cooperate with Congress’s impeachment inquiry.

Transcripts from closed-door depositions with diplomats conducted as part of the House’s impeachment inquiry and released publicly this week show that Giuliani’s name has been mentioned hundreds of times in the sessions.

The diplomats have testified that they came to understand over the summer that Giuliani was telling Ukrainian officials that they needed to release a public statement promising to investigate the unsubstantiated theory that their country interfered in the 2016 election, as well as a company whose board included Biden’s son. The diplomats have described Giuliani’s efforts as a shadow diplomacy conducted outside the normal channels of U.S. policymaking.

A transcript released Wednesday shows that William B. Taylor Jr., the acting ambassador to Ukraine, told lawmakers that it was his “clear understanding” that U.S. military aid would not be sent to Ukraine until the Ukrainians committed to initiating the investigations that Giuliani sought.

Giuliani had said that in addition to working with Parnas and Fruman on his Ukraine research, he had also been offering paid advice to a company co-founded by Parnas. Giuliani said he was paid $500,000 for the advice he provided to the company, the Florida-based Fraud Guarantee.

In the weeks after a whistleblower complaint about Trump’s Ukraine policy became public and the impeachment inquiry began, Giuliani had been given multiple daily interviews to reporters about his activities in Ukraine and his interactions with Parnas and Fruman.

“Why do I need a lawyer? I haven’t done anything wrong,” Giuliani said in an October interview with The Washington Post, after he dismissed his first lawyer.

In recent days, he had ended his round-the-clock interviews and cut down significantly on his media contacts.

However, in a series of tweets on Wednesday, he insisted that his work on Ukraine was conducted “solely as a defense attorney to defend my client” — Trump — “against false charges, that kept changing as one after another were disproven.”

He continued that he was confident that the evidence “when revealed fully, will show that this present farce is as much a frame-up and hoax as Russian collusion, maybe worse, and will prove the president is innocent.”

He then announced the hiring of his legal team. None of the three lawyers named by Giuliani responded to requests for comment Wednesday.

One of the three, Costello, was at the center an episode involving Giuliani and Michael Cohen, Trump’s former personal lawyer, that was documented in the report released in April by special counsel Robert S. Mueller III.

During the special counsel’s investigation, as Cohen faced possible indictment in New York for financial crimes, he alleged that allies of Trump dangled the possibility that he could be pardoned if he remained loyal to the president.

According to the Mueller report, Costello wrote in an April 2018 email to Cohen that he had spoken to Giuliani and that Cohen could “sleep well tonight” because he had “friends in high places.”

Cohen ultimately cooperated with prosecutors and pleaded guilty, including to campaign finance violations he said were undertaken at Trump’s direction.

Federal prosecutors in New York requested documents from Costello over his emails to Cohen, though Costello denied that there was any “hidden message” in his communications to Cohen.

Josh Dawsey and Matt Zapotosky contributed to this report.