LONG BEACH, Calif. — A resident of a retirement home in Southern California opened fire on firefighters responding to a report of an explosion in the building, killing a veteran fire captain and wounding a second firefighter and another person, officials said.

The shooting happened after firefighters responded to an alarm shortly before 4 a.m. at the 11-story retirement facility in Long Beach, south of Los Angeles, and found some windows blown out, activated sprinklers, the smell of gas and a fire that they extinguished, authorities said.

Firefighters were searching the building when shots were fired and the two firefighters were hit, Long Beach Fire Chief Michael DuRee said.

Fire Capt. Dave Rosa, who had worked for the department for 17 years, died at a hospital Monday morning, DuRee said.

The other firefighter who was shot was not immediately identified and was hospitalized in stable condition. A third person was also shot and was in critical condition.