Charleston police on Friday arrested a 17-year-old accused of accidentally shooting himself in the leg at his ex-girlfriend’s home.

Thomas Ancrum is charged with second-degree burglary, unlawful carrying of a firearm and discharging a firearm within city limits, jail records show.

On Friday afternoon, police officers were dispatched to an apartment on William Kennerty Drive concerning shots fired in the area, an incident report states.

A 40-year-old woman at the apartment told officers that her daughter’s ex-boyfriend walked into their home uninvited and shot himself after family members asked him to leave.

The teen limped out of the apartment and was later picked up by officers at a Rite Aid on Ashley River Road, according to an incident report.

Investigators found a semi-automatic pistol at the home and a spent 9mm shell casing, an incident report states. The gun had been in Ancrum’s waistband when it discharged, police spokesman Charles Francis said.

Ancrum was transported to St. Francis Hospital for treatment, police said. He is currently being held at the Charleston County jail, jail records show.