Rudolph W. Giuliani was an ardent supporter of President Trump during the 2016 campaign, and the former New York mayor was considered for the post of attorney general. (Mike Segar/Reuters)

Former New York mayor Rudolph W. Giuliani and two other former federal prosecutors joined President Trump’s legal team Thursday following weeks of turbulence and struggles to find attorneys who would agree to represent the president in the ongoing federal probe into Russian election interference.

The reshuffling comes at a particularly tense juncture for Trump, who aides said is increasingly frustrated by special counsel Robert S. Mueller III’s investigation and with the senior officials at the Justice Department.

The entry of Giuliani, an experienced attorney with a combative reputation, immediately raises questions about how Trump will engage with Mueller and the leadership at Justice. Some Trump advisers are concerned that the president could use his executive authority to close or diminish the special counsel probe, which has spawned a parallel investigation in New York targeting his personal attorney.

“I’m doing it because I hope we can negotiate an end to this for the good of the country and because I have high regard for the president and for Bob Mueller,” Giuliani said in an interview Thursday.

Trump said in a statement that Giuliani “wants to get this matter quickly resolved.”

In recent days, the president has been regularly venting and speculating to aides about his legal status and the expected timeline for the Russia investigation to end, according to associates briefed on the discussions.

Trump also loudly and repeatedly complained to several advisers earlier this week that former FBI director James B. Comey, former deputy FBI director Andrew McCabe and former Democratic presidential nominee Hillary Clinton, among others, should be charged with crimes for misdeeds alleged by Republicans, the associates said.

Although White House officials said Thursday that Trump has not called Justice Department officials or taken any formal action, the persistent grousing has made some advisers anxious, according to two people close to the president. A publicity tour by Comey to promote his book critical of Trump, “A Higher Loyalty,” has attracted particular attention from the president, who has disparaged Comey publicly and privately.

Trump also complained this week about Supreme Court Justice Neil M. Gorsuch, saying the judge had proved too liberal in recent cases, according to administration officials who heard about the complaints. Associates said he was incensed that Gorsuch had voted against the administration on an immigration case and said it renewed his doubts that Gorsuch would be a reliable conservative. One top Trump adviser played down the comments as unhappiness with Gorsuch’s decision rather than with Gorsuch broadly.

Giuliani, 73, brings a familiarity with several of the legal fronts that Trump is navigating. He is a former associate attorney general and a former U.S. attorney for the Southern District of New York, which is the office overseeing an investigation of Trump’s personal attorney, Michael Cohen.

Trump counsel Jay Sekulow said Thursday that former federal prosecutors Jane Serene Raskin and Marty Raskin, a couple who manage a Florida-based law firm, have also agreed to join the legal team.

Giuliani is certain to come under intense scrutiny for his role. His own pre-election activities two years ago have been the subject of criticism from Democrats, especially television interviews in which he suggested he had sources providing him inside information about…