Mr Trump posted an article to his social media platform Truth Social which included a composite picture of himself next to Alvin Bragg, who has accused the one-term president of creating “a false expectation” of being arrested this week.
The Manhattan grand jury is investigating hush money payments Mr Trump is accused of making to adult actress Stormy Daniels during the 2016 presidential campaign.
Mr Trump has repeatedly denied any sexual relationship with Ms Daniels.
But critics were quick to point out the Truth Social post featuring Mr Bragg and demanding that action be taken against Mr Trump.
“This threat is obstruction of justice and is a dangerous call to violence. Everyone needs to speak out,” wrote author Jennifer Taub on Twitter.
“Trump has today issued repeated stochastic terrorist calls for his cult to “remove” the “animal” Alvin Bragg - and use a baseball bat,” tweeted former MSNBC host Keith Olbermann.
And he added: “He’s trying to get this man killed. Period. Enough.”
CNN legal analyst Norm Eisen also spoke out about Mr Trump’s post.
“Threatening a prosecutor is a crime in NY. In fact MULTIPLE crimes: Harassment in the first degree NYPL 240.25; menacing in the second degree NYPL 120.14; stalking in the fourth or third degree NYPL 120.45 & 120.50 And that’s just for starters….” he tweeted.
Mr Trump’s post came as Mr Bragg’s office blasted House Republican chairs of the House Judiciary, Oversight, and Administration committees, who sent a letter claiming the investigation was an “unprecedented abuse of prosecutorial authority.”
The Manhattan District Attorney’s office general counsel Leslie Dubeck called the letter sent by the chairmen on 20 March “an unprecedented inquiry into a pending local prosecution”.
“The Letter only came after Donald Trump created a false expectation that he would be arrested the next day and his lawyers reportedly urged you to intervene. Neither fact is a legitimate basis for congressional inquiry,” she added.