Former New York City Mayor Rudy Giuliani is joining President Donald Trump's personal legal team.

"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 told The Washington Post.

Giuliani is a close ally of the president's and was a top Trump supporter on the campaign trail.

Last month, John Dowd resigned as the president's top outside attorney representing himin the investigation into Russian efforts to influence the 2016 election and whether the Trump campaign colluded with Moscow.

Trump considered Giuliani for an administration post when he won the 2016 election, but did not end up choosing him for a job.

Ty Cobb, the White House lawyer working on the Russia probe, did not immediately respond to CNBC's request to comment on an earlier Daily Beast report that Giuliani was in talks to join the legal team.

Giuliani was previously a federal prosecutor in Manhattan in the 1980s. He was mayor of New York City during the Sept. 11, 2001, terror attacks.

Giuliani Partners, a security and management consulting firm founded by Giuliani, and representatives for Giuliani did not immediately respond to CNBC's requests to comment.