BAKERSFIELD, Calif. (KGET) — The Bakersfield Police Department arrested two men and a juvenile late Wednesday night in east Bakersfield for firearm charges after leading officers on a chase.

Officers attempted to pull the car over for several vehicle code violations, but Erik Galvan, 25, refused to stop and led officers on a chase across east Bakersfield. The chase ended when Galvan crashed into a tree in the 2600 block of Oswell Street, officials said.

In addition to Galvan, officers also arrested Jose Arausa, 25, and a 16-year-old boy.

When officers were handcuffing Galvan, they noticed he was suffering from a gunshot wound to the right side of his butt.

An investigation revealed a gun was accidentally discharged by one of the two passengers during the chase, according to BPD. Galvan was transported to Kern Medical to receive treatment for his injury.

Officers recovered loaded guns after a search of the car, BPD said. All suspects were arrested on firearm-related charges, with Galvan facing an additional charge of evading officers in a car.

Anyone with information regarding this incident is asked to call the Bakersfield Police Department at 661-327-7111.