The charges against Mamadou Diallo, the man who was accused of fatally attacking his wife’s would-be rapist in the Bronx in May, were dropped Wednesday.

“Mr. Diallo, you’re free to go,” Justice Marc Whiten said, amid loud clapping in the courtroom.

advertisement | advertise on newsday

His family, including his wife and three sons, appeared overwhelmed by the unexpected outcome. The appearance was originally scheduled to be a routine hearing to discuss a possible plea deal.

Diallo was charged with assaulting Earl Nash with a tire iron as Nash tried to run away after attempting to rape Diallo’s wife on May 30. An autopsy found that Nash, who his family said suffered from schizophrenia, died from cardiorespiratory complications associated with his injuries, acute cocaine intoxication and heart disease.