The body of a Pennsylvania man who chased a code enforcement officer with a firearm and engaged in a standoff with police was found hours after multiple explosions and a fire he started destroyed three homes, authorities said Friday.

The Lower Providence Township Police Department said the man was identified as Thomas Razzi, 66, during an autopsy. His cause of death is still pending. His body was discovered around midnight Friday in the Eagleville, Pennsylvania apartment unit where he lived. 

Thursday's chaotic chain of events began just before noon amid reports that Razzi chased a code-enforcement officer with a firearm. The officer arrived at Razzi's home to perform a follow-up inspection after complaints of "hoarding conditions."

When the officer entered, Razzi displayed a firearm, prompting the inspector to leave, police said. 

AMAZON WAREHOUSE FIRE IN MARYLAND IGNITED BY SOLAR PANELS: INVESTIGATORS

Firefighters fight a three-alarm fire that broke out after a number of explosions at a Pennsylvania apartment complex. The body of a suspect that engaged in an armed standoff with police was later found inside his home. 

When two Lower Providence Township police officers arrived at the scene, they confronted Razzi in front of the home and ordered him to stop. Razzi, who was unarmed at the time, instead went inside the residence and slammed the door, police said. 

As additional officers arrived, a series of explosions and gunfire were heard coming from the home and a fire broke out. Officers did not fire their weapons, police said. 

Authorities later learned Razzi made his own fireworks and had several firearms and ammunition inside, police said. Investigators believe the gunfire was ammunition exploding from the heat of the fire. 

As the fire became visible, officers began evacuating neighbors. Three homes were destroyed and another three were damaged. Displaced residents were being assisted by the local Red Cross. 

The code enforcement officer suffered minor injuries and was treated and released from a local hospital.

CLICK HERE TO GET THE FOX NEWS APP

An investigation into the fire was conducted by the Lower Providence Township Fire Marshal several other agencies, including the FBI and the Bureau of Alcohol, Tobacco, Firearms and Explosives (ATF). 

Authorities believe the cause of the explosions was the result of mixing chemical substances used to make illegal fireworks. The investigation into the incident is ongoing.