The fire that destroyed three homes and prompted an hours-long lockdown in Eagleville on Thursday was started by a resident with homemade fireworks, police said Friday.

Thomas Razzi, 66, died in the blaze, which investigators say he intentionally set after being confronted by a code-enforcement officer from Lower Providence Township. Detectives discovered Razzi’s body just before midnight Friday inside the unit he rented in Eaglestream Apartments.

The code-enforcement officer, police said, was at Razzi’s home for a follow-up inspection after neighbors had complained of “hoarding conditions.”

» READ MORE: Resident threatened Lower Providence Township employee before fire, explosions, police say

When the officer arrived about noon on Thursday, Razzi confronted him with a gun and chased him out of his home, investigators said. Razzi went back inside and slammed the door behind him after police arrived, they said. Soon after, explosions and gunfire were heard from within Razzi’s home, and a large fire broke out.

Investigators say no police officers at the scene discharged their weapons — they believe the gunfire occurred as ammunition Razzi had inside his home exploded from the heat of the fire.

The blaze quickly spread, destroying three homes and damaging three others, according to police. Residents were evacuated and surrounding schools and businesses were locked down for several hours.

In the aftermath of the fire, Razzi’s neighbors described him as quiet and friendly. He had few visitors, they said, and largely kept to himself.

The code-enforcement officer was treated at a local hospital for minor wounds and later released.

Investigators were still probing the cause of the fire Friday. Early reports indicated that Razzi started the blaze by mixing household chemicals to create the fireworks, which neighbors told police he sold out of his home.

Anyone with information is asked to call Lower Providence Township Police at 610-539-5901.