(KTXL) — A 17-year-old is in the hospital after being shot by a Tracy Police Officer on Friday afternoon, according to the Tracy Police Department.

Police said that a call came in of two male subjects chasing each other with one of the males holding a knife in the Silvertail Place Foxtail Way area.

At 1:56 p.m., an officer arrived on scene and made contact with the teen that was holding a knife, who was “given commands to stop and drop the knife” by the officer.

Police say that the teen failed to follow the commands and “fearing for his safety and the safety of those in the area, the officer discharged his duty firearm, striking the individual.”

The 17-year-old was given first aid on scene by responding officers, which was then taken over by the South San Joaquin County Fire Authority and American Medical Response when they arrived on scene.

The teen was transported to the hospital and is in “serious but stable condition and is expected to survive,” according to police.