A hothead rapper steamed over a rival’s diss track opened fire on the wrong Dallas apartment, killing a 9-year-old girl instead of his intended target, police said.

Tyrese Simmons, 19, surrendered to cops late Thursday for the shooting death of Brandoniya Bennett, who died after being struck Wednesday as she sat inside her Old East Dallas apartment, police said.

“When the person refused to come out of the apartment, Simmons circled around to the back of the apartment complex and opened fire on the wrong apartment, fatally striking Brandoniya who was inside at the time,” Dallas police said in a statement.

Investigators later learned that Simmons and his intended target, an unnamed rapper who lived next door, traded barbs on social media and on diss tracks, KTVT reports.

Witnesses told police they had broken up an earlier squabble between the two, prompting Simmons to allegedly threaten that he intended to return to the building and “air this place out,” KDFW reports.

The girl — who had just gotten her nails done ahead of the start of the new school year — had no connection to either of the two men, both of whom are suspected of being gang members, according to the station.

“[Kids] don’t think about safety because as adults, as parents, as police officers, we’re supposed to make them safe,” an emotional Dallas police Major Danny Williams told reporters Thursday prior to Simmons turning himself in.

At least three people have been killed at the city-run apartment complex in little over a month, prompting 24-hour police patrols for the foreseeable future, according to KTVT.

Simmons, who has been charged with capital murder, remained held on $500,000 bond Friday, jail records show.