Former New York City mayor and U.S. attorney Rudy Giuliani is joining President Trump’s legal team, Fox News confirmed on Thursday.

Giuliani, who has been close friends with Trump for years and reportedly was under consideration for a cabinet post, told The Washington Post that he joined the team with the intent of bringing Special Counsel Robert Mueller’s probe to a conclusion.

“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 outlet.

Mueller, Giuliani told The Post, should be left to complete his investigation. "My advice on Mueller has been this: He should be allowed to do his job, he’s entitled to do his job.”

Before he was the mayor of New York City from 1994 to 2001, Giuliani served as U.S. attorney for the Southern District of New York from 1983 to 1999.

"The President said, ‘Rudy is great. He has been my friend for a long time and wants to get this matter quickly resolved for the good of the country,’" Trump lawyer Jay Sekulow said in a statement.

"I have had the privilege of working with Mayor Giuliani for many years, and we welcome his expertise," Sekulow added. "Mayor Giuliani expressed his deep appreciation to the President for allowing him to assist in this important matter. In a statement, Mayor Giuliani said, ‘It is an honor to be a part of such an important legal team, and I look forward to not only working with the President but with Jay, Ty, and their colleagues.’"

Giuliani made the decision to join Trump's legal team in the past few days following a dinner with the president ealier this month at Trump’s Mar-a-Lago resort, the Post reported.

The former mayor, a vocal advocate for Trump during the 2016 presidential campaign, was reportedly being considered for secretary of state following Trump's victory. Giuliani, at the time, said he wasn't interested in becoming Trump's attorney general. Ultimately, the president picked Rex Tillerson for the State Department and Jeff Sessions for attorney general.

Fox News' John Roberts contributed to this report.