Two officers were placed on modified duty after one of their guns accidentally went off inside a subway station in Brooklyn, according to an NYPD spokesperson.

Police say the officers were on duty at the Kingston-Throop Avenues subway station when gunfire rang out. A bystander and an officer were wounded during the commotion.

The investigation unfolded just before 4:45 p.m. Thursday on the southbound platform for the A/C lines.

The bystander, a 34-year-old woman, suffered minor injuries, according to police. The NYPD did not specify exactly how she was hurt during the incident. The woman was treated at a nearby hospital and has since been released.

Investigators say a bullet fragment struck an officer who was standing nearby. That officer – and the one who was carrying the firearm – were taken to the hospital.

According to the NYPD, both officers have been released – and disciplined.

Their names were not immediately available.

The NYPD’s Force Investigation Division is leading the ongoing investigation.