This is an archived article and the information in the article may be outdated. Please look at the time stamp on the story to see when it was last updated.

A California police officer was killed and another wounded Monday while serving a search warrant before officers shot and killed the gunman, authorities said.

Shots were fired shortly before 5:30 p.m. as officers served the warrant at an apartment in the Central Coast city of San Luis Obispo.

“This is a tragedy beyond measure for all of those who serve and care about our community,” City Manager Derek Johnson said in a statement. “Our deepest condolences go out to the family. We are devastated by this loss.”

The wounded officer was hospitalized in stable condition, the city reported.

Other details, including the names of the officers and the gunman, weren’t immediately released.

Victoria Torres, 21, told the San Luis Obispo Tribune that she was upstairs in her bedroom when she heard “a very loud knocking” at an apartment across from her.

“I don’t know if it was the police or what,” she said. “I always hear noises here so I didn’t think anything of it until I heard the gunshots.“

She looked out her window and saw a police car, then walked downstairs and looked out another window.

She saw a man carrying a “big gun” who began shooting from the door of an apartment at officers who were hiding behind their patrol car, Torres said.

Torres went back upstairs to hide and call 911.

Monica Rochte, 31, told the Tribune that she heard the police banging on an apartment door and saying: “We’re going to come in. We know you’re in there.”

Rochte said there was yelling and then a bang that she thought might be police knocking down the door, followed by a single shot.

Rochte then heard police yell: “He has a gun!” followed by a series of 15 to 20 shots, she said.