An off-duty Alameda County sheriff's deputy shot and killed an armed-robbery suspect and may have wounded a second gunman during a confrontation at a convenience store in Alameda, police said Friday.

The shooting happened at the Bonfare Market at 1505 High St. shortly after 10:30 p.m. Thursday.

The off-duty deputy, a 20-year veteran and SWAT team member assigned to Oakland International Airport, was reading a magazine at the store when two men wearing masks came in, authorities said.

"A confrontation occurred, and the deputy feared for his safety, as well as the safety of the employees who were working in the store at the time," said Alameda police Sgt. Wayland Gee.

The deputy used his department-issued gun to kill one of the suspects and wound the second man, authorities said. Neither of the suspects fired their weapons, investigators said.

The second gunman fled from the store. A man later showed up with a bullet wound at a local hospital, and investigators are trying to determine if he was connected to the incident, authorities said.

The deputy's name was not released. He and the two store employees were not hurt.

Sheriff's office policy allows deputies to carry their department-issued weapons while off-duty, authorities said.

The Bonfare Market was also robbed the night of July 10 by masked men with guns. Investigators are trying to determine whether the two incidents were related.

Police, sheriff's detectives and district attorney's investigators are looking into the shooting, the fifth involving sheriff's deputies this year.

In March, deputies shot and killed suspects in Oakland and Castro Valley. In May, a deputy shot and critically wounded a suspect who tried to drag another deputy with a car in Castro Valley. Last month, a deputy shot and killed an armed-robbery suspect in Castro Valley.

All the deputies in those incidents were on duty.