A Bronx man was charged on Tuesday with fatally beating the man who allegedly tried to rape his wife inside their apartment, police said.

Earl Nash, 43, was accused of breaking into the Washington Avenue home 51-year-old Nenegale Diallo shares with her husband Mamadou Diallo at about 9:30 p.m. on Monday, police said. He pushed the door in, and threw Diallo to the ground, punching her, said her husband’s brother, Ibrahima Diallo.

He then tried to remove her clothes, police said. But Nenegale, who was in the apartment with a friend at the time, was able to break free and call her 61-year-old husband.

Working nearby as a taxi driver, Mamadou Diallo rushed to his wife’s aid but ran into Nash in the hallway near their apartment, his brother and police said.

“He’s innocent,” said Ibrahima Diallo, 52, adding that his brother’s family came from Guinea nearly 30 years ago. “Somebody comes to your house to kill, what do you do? You fight, you do anything to survive. He wants to defend his family.”

Diallo allegedly attacked, hitting Nash with a tire iron, a law enforcement official said. Nash fought back, lashing Diallo with a belt, the official said.

Nash was then taken to an area hospital where he died, police said.

Diallo was charged with manslaughter and was awaiting arraignment on Tuesday evening. An attorney didn’t immediately respond to a request for comment.

Hours after the attacks, investigators combed through the building and guarded the Diallos’ apartment.

Building resident Renny Sanchez said she was surprised at what happened and that she has always felt safe at home.

“You never think something like that would happen in the building,” she said. “I always feel safe around here, we have a lot of cameras.”