COSTA MESA (CBSLA) — A possibly suicidal 26-year-old man who allegedly fired shots at a Costa Mesa Police Department officer and a civilian was wounded after being shot by an officer.

Officers received a call at 3:43 p.m. about a possibly suicidal man armed with a handgun in the area of Orange Avenue and Palmer Street, according to police.

READ MORE: Mobley Leads No. 20 USC To 93-73 Victory Over Utah

An officer in the area found a suspect matching the description. Police said the man, identified as Steven Fernandez of San Diego, fled on foot while firing several shots at the officer, taking cover in a garage in the 200 block of Knox Place where police said he then shot at a resident.

Fernandez was confined to the garage, and a SWAT team was called in an attempt to negotiate with Fernandez.

As negotiations took place, police said Fernandez displayed a gun and was subsequently shot and injured by an officer.

READ MORE: Anaheim Ducks Hold Off Vegas Golden Knights For Wild 6-5 Win

Fernandez was arrested on suspicion of attempted murder of a police officer and was taken to the hospital for treatment. He is expected to survive.

Police said two handguns were recovered at the scene.

No officers or civilians were injured in the shootings.

MORE NEWS: Jacqueline Avant, Wife Of Music Executive Clarence Avant, Found Shot To Death In Beverly Hills Home Invasion

(© Copyright 2019 CBS Broadcasting Inc. All Rights Reserved. City News Service contributed to this report.)