The man accused of killing a Brooklyn philanthropist last week allegedly stabbed him 22 times and then set his house on fire, prosecutors alleged at his arraignment Wednesday.

Dondre Richardson, 33, was ordered held without bail at his arraignment on murder and arson charges for the slaying of L. Antonio Litman at his home on Adelphi Street in Fort Greene on Jan. 20.

After knifing Litman to death, Richardson set the house on fire and left a bloody knife with his DNA on it at the scene, prosecutors said.

Richardson, who lives in a homeless shelter on Wards Island, was arrested by the NYPD’s warrant squad and brought in for questioning at Brooklyn’s 88 precinct on Tuesday.

During the questioning, he stripped naked and began urinating in the precinct, prosecutors said. He had to be transferred to a hospital for psych evaluation after the outburst.

Richardson, a convicted sex offender, allegedly had a sexual relationship with Litman before the grisly slaying, sources previously told The Post.

Litman was found in the lobby of the building, which housed his charity Virginia’s House of Hope, when FDNY firefighters responded to the blaze that morning at 3:30 a.m., authorities said.