(KTXL) — A man allegedly shot a California Highway Patrol officer and two adults he took hostage, killing one and injuring the other, before being detained by law enforcement at Mahany Park in Roseville on Thursday.

At around 12:30 p.m., law enforcement heard the CHP announce over dispatch radios that an officer had been shot, according to police and CHP officials that spoke at a news conference.

A law enforcement officer that responded saw a suspect flee on foot and take two bystanders hostage, officials said.

Both of the hostages were struck by the suspect’s gunfire, resulting in the death of one of them, according to Roseville Police Captain Kelby Newton.

During the shootout between law enforcement and the suspect, nearby Woodcreek High School, the Riley Library and the Mahany Athletic Center were placed on lockdown, according to the Roseville Police Department and the Roseville Joint Unified High School District.

More Mahany Park stories

What we know about the shooting at Mahany Park in Roseville
Roseville firefighters rescued CHP officer shot at Mahany Park
‘There were bullets flying’: Witness recalls shooting at Roseville’s Mahany Park
Roseville Mayor, City Manager comment on Mahany Park shooting

A witness that spoke with FOX40 said that he was at a nearby ballfield and saw several officers “with their guns drawn…yelling at (a young man) to get down. He turned around, I think I saw a gun flash, and the cops just opened up on him. It was very scary for these kids. There were bullets flying.”

The suspect was brought into custody at 1:35 p.m. and no other people or officers were injured, according to officials.

The surviving hostage and the CHP officer were taken to a nearby hospital, officials said.

The suspect was injured in the shootout and taken to a hospital.

Law enforcement officers responded from the Sacramento County Sheriff’s Office, California Highway Patrol, Lincoln Police Department, Rocklin Police Department, Placer County Sheriff’s Office and the Roseville Fire Department.

At 3 p.m., the Roseville Police Department announced that all Mahany Park facility lockdowns had been lifted and that the fitness center and library will remain closed for the rest of the day.