A man is in custody after police said he fatally stabbed his girlfriend and injured her young granddaughter inside an apartment in the Bronx Wednesday morning.

The attack happened at an apartment in the St. Mary’s Park Houses on East 156th Street at around 5:05 a.m., the NYPD said.

According to police, the 9-year-old girl told officers that she ran from the apartment after her grandmother’s boyfriend stabbed her. The girl suffered stab wounds to her shoulder and left leg and was taken to Lincoln Hospital in stable condition, police said.

When officers arrived, police said the 55-year-old man had barricaded himself inside the apartment. When they gained entry, they discovered a fire had been set, police said. Members of the FDNY quickly extinguished the flames, police said.

The girl’s 60-year-old grandmother was found inside the apartment with multiple stab wounds, according to the NYPD. She was pronounced dead at the scene, the NYPD said.

The suspect was also found inside the apartment with what police said appeared to be self-inflicted stab wounds to the chest. He was taken to Lincoln Hospital in critical condition, according to the NYPD.

Police said the investigation into the incident is ongoing.