Trump is standing by his man.

The president launched an impassioned defense of longtime pal Rudy Giuliani on Saturday after a report claimed the former mayor was being investigated by federal prosecutors in Manhattan.

“So now they are after the legendary ‘crime buster’ and greatest Mayor in the history of NYC, Rudy Giuliani,” Trump tweeted Saturday. “He may seem a little rough around the edges sometimes, but he is also a great guy and wonderful lawyer.”

He blamed the “Deep State” for his embattled attorney’s legal woes.

Investigators are looking into Giuliani’s efforts to convince Trump to remove former Ukraine Ambassador Marie Yovanovitch, The New York Times reported Saturday.

Prosecutors in the Southern District of New York — which Giuliani led as a crusading US. attorney before his 1994 election as mayor — are probing potential violations of federal lobbying laws in his dealings with the Ukraine government.

They are also investigating business ties between Giuliani and two men who were arrested Wednesday and accused of helping Rudy find damning information on Joe Biden’s Ukraine activities while he was vice president.

Trump has accused Biden of strong-arming Ukraine into firing a prosecutor who had targeted a company that gave Biden’s son Hunter a lucrative job on its board.

Giuliani has pressed the case — despite Biden’s heated denials — in a series of fiery media appearances in recent weeks.

But top Republicans fear that Rudy’s loose-cannon interviews could torpedo his boss’s impeachment defense.

“I think he’s massively hurting,” an unnamed source told Politico Saturday. “He’s creating an impression of internal chaos.”

“Rudy Giuliani needs to stop talking,” a former Trump campaign official added.

But former Trump campaign aide Jason Miller said that the president’s tweet cemented their bond.

“Trump made very clear that Mayor Giuliani is on his team and an ally and essentially puts this question to rest,” Miller told The Post.

“I think the president has always appreciated Mayor Giuliani’s attack dog nature,” Miller said.

And GOP strategist John Feehery said that all the bluster served a purpose.

“If this were any other president, Rudy would be a disaster,” Feehery said. “There is a method to the madness. The goal is to always stay on offense and not be defensive.”

On Friday, Trump seemed to signal doubts about Giuliani’s continued role as his legal adviser.

“Well, I don’t know,” he told reporters as he left the White House for a campaign rally in Louisiana. “I haven’t spoken to Rudy.”

Giuliani said that he remains on Trump’s legal team — but is not handling Ukraine matters.

“There are no Ukraine issues. I finished that in March,” he told CNN. “I’m still representing him.”