Story highlights This marks the first fatal shooting of officer in transit agency's history

The shooting happened in connection with a search of an apartment

Authorities are saying the shooting was an accident

BART chief says he is "deeply saddened"

A California transit officer shot and killed another officer Tuesday in an incident that authorities are calling a "tragic accident."

The two Bay Area Rapid Transit police officers were conducting a search Tuesday afternoon of a Dublin apartment in connection with a spree of train robberies when the shooting occurred, according to Alameda County Sheriffs spokesman Sgt. J.D. Nelson.

During the search, the "officer accidentally fired his weapon and struck and killed another officer," Nelson said. "This appears to be a terrible and tragic accident."

The incident is being investigated.

BART Police Chief Kenton Rainey said he was "deeply saddened" by the incident.