By Cecilio Padilla

WINTERS (CBS13) — A 17-year-old Winters boy has been arrested after a chaotic incident that allegedly began with him pulling out a knife and threatening to kill officers and ended with a deputy opening fire during the struggle to take him into custody.

Winters police say, just after 6:30 p.m. Sunday, officers responded to outside the lobby of their own police department and found the teen armed with three-inch knife. The teen allegedly yelled he wanted to kill the officers – and he stabbed and kicked the doors of the lobby several times.

While backup was being called from the Yolo and Solano county sheriff’s departments, the teen allegedly pulled out what looked like a handgun out of his pocket.

Officers say the teen didn’t point the weapon at them, but he did show off. The teen eventually threw the weapon into some bushes nearby, then continued to hold the knife and threaten officers.

The teen ran when he heard the siren of an approaching Yolo County Sheriff’s Department unit, officers say. Officers immediately started chasing after him.

Officers found the teen along Aster Way and tried to stop him with a stun gun, but it didn’t take him down. At one point during the ensuing struggle with the teen, a deputy opened fire. The teen was not hit, police say, and he was eventually taken into custody but still continued to resist.

Two Winters police officers suffered minor injuries during the struggle, police say.

More from CBS Sacramento:

The teen was taken to the hospital to be medically cleared before he was booked into the Yolo County Juvenile Detention Center. He’s facing felony charges of resisting an officer by threat or violence and assault with a deadly weapon.

Officers recovered the knife the teen was holding and also found that handgun he threw into the bushes was actually a replica Glock pistol.