Updated at 1:15 p.m., March 18, 2015

An apparently accidental non-injury shooting at an apartment building at UC San Diego prompted a several-hour SWAT standoff early Wednesday and left three people in police custody.

The gunfire erupted during a fight at the residential complex in the 3900 block of Miramar Street about 1:30 a.m., according to San Diego Police.

Arriving officers immediately confronted and arrested the suspected shooter, a 28-year-old graduate student who lives in the building, university spokesman Jeff Gattas said.

Authorities evacuated everyone else from the building while trying to detain two people who remained in the unit where the firearm, believed to be a shotgun, had gone off. They initially refused to give up, prompting police to bring in a special weapons and tactics squad to prepare to forcibly enter if necessary.

About 4:15 a.m., SWAT officers set off a “flash bang” grenade in the apartment to try to drive the pair out, Gattas said. A short time later, a man exited and was taken into custody.

The other occupant, a woman, remained inside for about another hour before finally surrendering. Both were interviewed and released, the spokesman said.

The suspected shooter was expected to face charges of possession of a firearm on a campus and negligent discharge of a gun. His name was not immediately released.

The circumstances that led to the disturbance and gunfire were unclear, Gattas said.

— City News Service

Chris Jennewein is Editor & Publisher of Times of San Diego.