A 77-year-old man charged with murdering a Long Beach firefighter at a retirement home told investigators that he started shooting after an explosion in his room because “he got scared,” according to a search warrant filed by police.

In the warrant, police describe the chaotic scene at the 11-story Covenant Manor apartments on June 25 where LBFD Capt. David Rosa was gunned down after he and other firefighters doused a blaze on the second floor.

After the flames were extinguished around 4 a.m., gunshots rang out near room 210, wounding two firefighters and sending people fleeing out of a stairwell, according to the warrant.

Thomas Kim, who lived in room 210, is charged with setting off the explosion and then killing Rosa, grazing firefighter Ernesto Torres with gunfire and wounding another resident at the Covenant Manor.

In the warrant, police say they found Kim with burned hair and burned clothes.

He told officers there’d been an explosion in his apartment and he had gasoline in his kitchen, the document states.

“Kim admitted to officers he has a revolver, and he got scared and started shooting,” according to the warrant.

Police wrote that they found a revolver in the building’s west stairwell.

While officers were driving Kim to the police station, he told them he had a note in his pocket, according to the warrant.

Last week, police said the note indicated Kim intended to carry out a murder-suicide.

Prosecutors said Kim had set off the explosion in his apartment trying to kill his upstairs neighbor, with whom he’d been feuding.

A neighbor told the Long Beach Post that Kim complained about other people in the complex making too much noise.

Kim’s brother, George Kim, said Kim is a retired civil engineer who disappeared during a business trip to Mexico decades ago. George Kim said he had no idea his brother was living at the retirement home for low-income seniors in Long Beach.

Thomas Kim is now facing two counts of attempted murder and one count each of murder, attempted murder of a firefighter, arson of an inhabited structure and explosion with intent to murder.

Medical issues have repeatedly delayed his first court appearance, according to authorities. He’s now expected to be arraigned on July 16.

Prosecutors could pursue the death penalty if he’s convicted. He’s being held without bail.

Jeremiah Dobruck is managing editor of the Long Beach Post. Reach him at [email protected] or @jeremiahdobruck on Twitter.