A gun went off when a Yale police officer used a firearm to break a car window on Wednesday to help someone who was trying to hurt themself near the university, Yale officials said.

The incident unfolded shortly after 9:20 a.m. when officers from the Yale Police Department responded to the area behind 205 Whitney Ave. for an unspecified report, according to university officials.

The first officer on scene found an individual inside a locked vehicle allegedly trying to harm themself, officials said. The officer broke the window using a gun that went off, officials said.

University officials did not specify whether the officer intentionally shot the gun through the window or if it went off accidentally while trying to shatter the glass. No one was struck by gunfire, officials said.

The individual was removed from the vehicle before the officer gave them medical attention for self-inflicted injuries, university officials said. The individual was then taken to Yale New Haven Hospital for additional treatment.

The officer received a medical evaluation, officials said.

According to Yale, the Connecticut Office of Inspector General is investigating the incident. The office is tasked with investigating all uses of deadly force involving police and in-custody deaths.

According to Yale officials, university police are cooperating with the investigation.

“Yale sends its thoughts to all involved in the incident and wishes them well as they receive medical care,” officials said in a statement.

Whitney Avenue was closed at Sachem Street and Humphrey Street for the investigation.