TOWSON, Md. — A police officer who shot and killed a Maryland woman during a six-hour 2016 standoff has told a jury he had no choice but to shoot.

A jury is hearing the case brought by relatives of Korryn Gaines of Randallstown against the county and the officer who shot her, Royce Ruby.

News outlets report Ruby took the stand Monday in a Baltimore County courtroom. He testified that during the standoff, Gaines sat in the hallway of her apartment with a shotgun on her lap.

He said he pulled the trigger after Gaines moved and disappeared from his sight, but he saw the barrel of her shotgun rising into a firing position.

Officers went to the apartment to serve a warrant. Prosecutors ruled the shooting justified and filed no criminal charges.