A New York man willing to testify against MS-13 members who attacked him in 2018 was found dead earlier this week after his identity was disclosed to defendants’ attorneys in pre-trial proceedings, police say.

The bludgeoned body of 36-year-old Wilmer Maldonado Rodriguez was found Sunday outside an abandoned home in New Cassel, the Nassau County Police Department announced Wednesday. Investigators said Rodriguez in October 2018 came to the defense of two boys who were being threatened by the gang — only to be beaten with a bat and stabbed, according to Newsday.

"This courageous man was prepared to testify against his alleged assailants at an upcoming trial, but he was brutally beaten to death before he could," Nassau County District Attorney Madeline Singas said in a statement provided to the newspaper.

"This case underscores the importance of safeguarding the identities of witnesses and victims of crime and our hearts are with Mr. Maldonado’s family and friends as we grieve his loss.”

MS-13 GANG MEMBER WILL SERVE 50 YEARS FOR MURDER OF 14-YEAR-OLD

Singas says prosecutors tried to keep Rodriguez’s identity secret by obtaining a protective order in December 2018.

But last December, ahead of looming changes to New York’s criminal justice system, including reforming the pre-trial discovery phase – during which prosecutors reveal evidence to the defense for preparation – the judge in the case issued a new order.

It allowed “for the disclosure of the protected information to defense counsel,” Newsday reports. The judge’s order, it added, required attorneys for two defendants not to reveal Rodriguez' s name to their clients until the trial’s start date of Jan. 6.

However, Nassau Police Commissioner Patrick Ryder said Wednesday that the trial was delayed.

“We don’t know if the defense counsel turned that information over to the defendants, but we do know that right after that time period… started this pattern of intimidation,” Ryder said.

He told reporters Wednesday that another witness on the case was shot at in New Cassel on Jan. 30.

PROSECUTORS TO SEEK DEATH PENALTY AGAINST MS-13 LEADER LINKED TO MURDERS OF 2 VIRGINIA TEENS

“On February 1st, 2020, Wilmer, our now victim, deceased, was also beaten on and he escaped from there,” Ryder said. “Then on February 2nd, we found Mr. Rodriguez’s body.”

“The individuals whoever did this attack, we believe had received that information,” Ryder concluded, referring to Rodriguez’s identity. He noted that the investigation into Rodriguez’s killing is ongoing and no suspects have been identified.

Both attorneys, though, are denying that they disclosed any names of witnesses or victims to their clients.

“I never gave him the name of those people. And he never asked me for it,” lawyer Greg Madey, who is representing 20-year-old Denis Pineda, told Newsday. “I’m offended by the allegation that Denis Pineda had something to do with orchestrating this murder.”

Justin Feinman, who is representing 19-year-old Elian Ramos Velasquez, told Newsday that “at this point to say that it was a defense attorney that leaked without more information is completely inappropriate.”

CLICK HERE TO GET THE FOX NEWS APP

“I feel horrible that this happened,” Feinman added. “This should have never happened. I just don’t see how you can blame a particular judge or attorney.”

The trial Rodriguez was supposed to testify in is set to begin sometime this week, Ryder said Wednesday.