The death of a 64-year-old Lower East Side man who died after being beaten and held prisoner inside his own bedroom has been ruled a homicide by the city medical examiner.

Doru Vaduvescu died of heart failure days after police said Truman Delaney, 46, attacked him and held him and his 68-year-old wife prisoner by nailing the door to their Lower East Side bedroom shut, according to a report by NBC-TV.

Delaney allegedly beat Vaduvescu during the Aug. 20 incident, leaving the elderly victim bruised and with broken bones before locking him up without water for 30 hours — both of which contributed to his death, the coroner said Thursday.

The nightmare only ended when Vaduvescu’s wife was somehow able to escape by climbing out of the couple’s bedroom window and into the basement, where she was able to call for help.

Delaney was charged with assault, grand larceny, unlawful imprisonment and other charges.

It was unclear if Delaney knew the Vaduvescus or how he came to be in their apartment.