(CNN) - It started with a feud between neighbors at a retirement home, prosecutors say.
And it ended with an explosion at the facility and the shooting death of a firefighter who was responding to the scene on Monday.
Thomas Kim, a 77-year-old retirement home resident, is accused of shooting and killing Capt. Dave Rosa, 45, as the veteran firefighter was responding to an explosion, allegedly triggered by Kim. A second firefighter, Ernesto Torres, was also shot but is expected to make a full recovery. Another man who lived in the building was also shot and injured, prosecutors said.
Kim is charged with one count of murder, one count of attempted murder of a firefighter, two counts of attempted murder, one count of arson of an inhabited structure and one count of explosion with intent to murder.
Investigators believe that the fire wasn't set to ambush the firefighters, but that it stemmed from the feud with the neighbor, according to a statement from the Long Beach Police.
Kim had allegedly been involved in a dispute with a woman who lived above him and set off an explosive device in his apartment, intending to kill her, said the Los Angeles County District Attorney's Office.
The fire department responded to a fire alarm, in addition to calls of an explosion and fire near 4 a.m. Monday, after residents at the senior living facility smelled gas.
After the initial fire had been knocked down, shots rang out minutes later, authorities said.
Kim sat at the end of the hallway from his apartment after the explosion and is accused of firing at Rosa as the firefighter made his way down the hall. Kim allegedly also opened fire on Torres and another man in the building, according to prosecutors.
Investigators recovered a handgun at the scene and a note written by Kim that led them to believe this may have been a murder-suicide attempt, Long Beach Police said. But the motive is still under investigation.
A neighbor told CNN affiliate KCAL that Kim had recently let go of his caregiver and had given away some of his belongings.
"I do know that he was upset with the lady above him," Sue Windmiller-Smith, a neighbor of Kim's told the station. "He was saying she was making noise in the night, and he would call the police and have the police go up there."
If convicted on the charges, Kim could face the death penalty or life in state prison without the possibility of parole.
Remembering Capt. Dave Rosa
Rosa had been with the Long Beach Fire Department for 17 years and had served as captain for more than six years. He leaves behind a wife and two sons, ages 25 and 16.
California Gov. Jerry Brown expressed his condolences to Rosa's family and the state Capitol flags were flown at half staff in his honor.
"Firefighters deal with fire, not bullets," Long Beach Police Sgt. Brad Johnson said on Monday. "It's a sad time in Long Beach history to have firefighters injured just responding to their job."
A memorial service for Rosa will be held Tuesday, according to the fire department.
Copyright 2018 by CNN NewSource. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.