An early morning standoff between police and a suspect in Northeast Dallas on Thursday ended in an arrest, with no injuries reported.

Dallas police responded to reports of gunfire at an apartment complex off Skillman Street near the SMU campus at about 12:15 a.m. in Council Member Paula Blackmon’s District 9. There, they found a man firing a weapon intermittently from inside an apartment where he had barricaded himself. Residents in the surrounding area were evacuated, and the SWAT team was called to the scene, per WFAA.

The man, whose name has not been released yet, refused to come out of the apartment and continued firing periodically. He reportedly yelled obscenities at the officers, saying that they would not take him alive and that he would kill them all.

The man’s family members spent hours trying to convince him to surrender. Neighbors told WFAA that they heard flash bangs go off, and then the man came out of the apartment a short time afterward and surrendered to police. The standoff ended around 7:30 a.m.

The incident may have begun as a domestic dispute, officers told WFAA. The man’s family members said that he may have been experiencing a mental health episode.

Dozens of officers responded to the scene during the seven-hour standoff, even as the Dallas Police Department continues to deal with a shortage of officers. The department is operating with about 1,000 fewer officers than recommended by a prior City report.

As a result, the crime rate remains relatively high, particularly in Downtown Dallas, where the number of crimes continually outpaces that logged in nearby Fort Worth’s downtown area. Fort Worth’s city center is patrolled by a specialized unit and private security guards.

DPD has also been enduring limited public safety spending. The City only budgeted the department $654 million for this fiscal year, which is much less than in other high-crime cities, such as New York and Chicago.