In a post on his Truth Social platform, the former president wrote, "Has disgraced attorney and felon Michael Cohen been prosecuted for LYING? Only TRUMP people get prosecuted by this Judge and these thugs!"

Cohen is expected to be a key witness for the prosecution at the trial, which is scheduled to begin with jury selection on Monday and will be the first criminal trial ever of a former American president.

Prosecutors have accused Trump of falsifying business records to hide a $130,000 payment to porn star Stormy Daniels ahead of the 2016 election to buy her silence about an alleged sexual encounter with Trump.

Cohen has said Trump ordered him to make the payment and then arranged for him to be reimbursed.

Trump has pleaded not guilty, and has denied having sex with Daniels, whose real name is Stephanie Clifford.

Justice Juan Merchan, who is overseeing the trial, imposed a gag order on Trump in March at prosecutors' request, blocking him from speaking about witnesses concerning their participation in the case.

He extended the order on April 1 to cover his own family members and those of Manhattan District Attorney Alvin Bragg, though Merchan and Bragg themselves are not included.

The district attorney's office did not immediately respond to a request for comment.

Cohen pleaded guilty in 2018 to federal charges that he violated campaign finance law through the payment to Daniels. He separately pleaded guilty later that year to lying to Congress in 2017 about a real estate project in Moscow, though he says he did so to protect Trump.

Trump, the Republican presidential candidate in November's election, has claimed he is the victim of political persecution.

He went after both Cohen and Daniels - another likely prosecution witness - on Truth Social earlier this week, calling them "sleaze bags."

(Reporting by Joseph Ax and Luc Cohen; Editing by Noeleen Walder and Jonathan Oatis)