HAYWARD (CBS SF) — A 27-year-old man was charged Wednesday with attempted murder of a peace officer and assault on a peace officer with a semi-automatic firearm for allegedly shooting at two BART police officers at the Hayward station on Christmas Day.

The Alameda County District Attorney’s Office also charged Charles Kyle Goetting, who has addresses in San Ramon, Concord and Antioch, with being an ex-felon in possession of a firearm, alleging that he has a prior conviction for possession of a controlled substance in Alameda County in 2013.

READ MORE: COVID Omicron Variant: CDC Expands Surveillance To San Francisco International Airport

BART spokesman Jim Allison said Goetting, who was injured when a transit agency officer returned fire in the incident on Christmas Day, is still hospitalized under police guard.

BART Detective John Johnson wrote in a probable cause statement that Goetting was pushing a white U-Haul truck into a parking stall on the basement level of the parking garage at the Hayward station at about 11 a.m. on Christmas Day when an officer observed a broken rear window on the truck.

Johnson said two uniformed BART officers contacted Goetting to investigate a possible vehicle burglary and Goetting then identified himself to them.

Johnson said the officers conducted a records check and learned that Goetting was on probation for his drug conviction and had a condition allowing officers to search him. However, when an officer started to search Goetting, he pulled a handgun from his waistband and fired five shots at the two officers.

One officer was shot in the arm by Goetting, Johnson said.

According to the district attorney’s filing document, that officer was Timothy Eads.

READ MORE: 3 Killed, At Least 8 Wounded In Shooting At High School In Michigan

Another officer returned fire and struck Goetting, who was taken into custody, Johnson said. Court documents identify that BART officer as Officer Carlos Dazhan.

When officers processed the crime scene, they found a dead body that was covered up in the bed of the U-Haul truck, according to Johnson.

The Alameda County coroner’s bureau has identified the man as 40-year-old Jason Anderson, whose last known address was in Bay Point.

Allison said Wednesday that Anderson’s death has been ruled a homicide and BART police are still actively investigating his death.

Goetting and Eads were both transported to hospitals.

Eads was treated and released but Goetting underwent surgery and is still in the hospital, according to BART.

The premeditated attempted murder charge against Goetting is for allegedly shooting Eads, while the assault on a peace officer charge is for allegedly shooting at Dazhan, who wasn’t injured.

MORE NEWS: 'Georgia's Defense Is Just So Good': CBS Sports’ Houston Nutt Previews SEC And Conference USA Championships

© Copyright 2015 by CBS San Francisco and Bay City News Service. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.