King County Sheriff’s Office deputies who shot and killed a Des Moines teen earlier this year said he reached for a gun and started to raise it in their direction in the moments before they opened fire.

“I believed his intention was to shoot,” Sgt. Todd Miller, one of the deputies, said during an inquest Thursday.

Miller, Det. Reed Jones, and Det. Joseph Eshom fired several times on Chance Gittens, 17, during an undercover operation in January that quickly went awry. The sheriff’s office was trying to make contact with Gittens’s friend, a teen who was a person of interest in a homicide case. Using Facebook, deputies set up a ruse to lure the teen out of a Des Moines apartment complex by pretending to be a minor who wanted to buy alcohol.

According to court testimony, that teen and Gittens approached a van full of detectives and deputies to complete the transaction, and were within arm’s reach of the vehicle when deputies flung open the door, startling Gittens and his friend.

“Police, police, get on the ground!” Eshom recalled deputies shouting at the teens.

The deputies said Gittens then reached toward his waistband, pulled out a handgun, and started raising it in their direction.

Miller said he fired on Gittens, striking him. The teen, still armed, spun away and appeared to be trying to flee, Miller said.

“As he was running up the driveway, I could still see the gun in his hand,” Miller said.

Eshom and Jones testified that they fired after Miller.

“He was refusing to surrender,” Eshom said, adding that they are trained to “fire until the threat is no longer there.”

The entire exchange lasted a matter of seconds, the deputies said.

The King County medical examiner told the inquest earlier in the week that Gittens was shot five times, including once in the head.

All of the deputies testified that a taser was not a viable option in that situation.

Gittens’s family members, seated in the Kent courtroom, were at times emotional as they listened to detectives describe what they witnessed that night. One left the room in tears.

“I want to let everyone know that my son never shot at officers,” Alexis Dunlap, Chance Gittens’s mother said in an interview earlier in the week. “So the question is, ‘How did my Chance end up dead? How did he end up being a victim in this crime?’”

The teen who was with Gittens the night of the shooting told the inquest on Wednesday that Gittens carried a loaded gun as they approached the van.

The inquest is an effort by the coroner to learn more about the circumstances surrounding Gittens’s death. It is not a trial of the deputies who fired the shots.