FREMONT, Calif. (KRON) — A Fremont man died after he allegedly ignited his apartment on fire and refused to leave when firefighters and police arrived, police said Thursday.

Police identified the man as William Farris. The Fremont Police Department said Farris’ cause of death is unconfirmed and still being investigated by the Alameda County Sheriff Coroner’s Office.

The May 20 incident began just after 9 a.m. in an apartment on Winema Common.

“Firefighters entered the apartment to combat the fire and attempt to rescue Farris. However, Farris yelled out that he had a firearm and wanted everyone to leave. (Firefighters) were forced to evacuate after Farris continually made threats towards them. Due to the fire hazard, coupled with the threat of a firearm, arriving police personnel set up containment around the apartment,” FPD wrote.

Farris remained inside the burning apartment and a 6-hour-long standoff with police ensued.

Crisis negotiators established communications with Farris and made numerous attempts to convince him to exit his burning apartment. Despite a large amount of smoke in the apartment, Farris repeatedly refused, according to police.

“For hours, officers warned Farris that it was extremely dangerous to subject himself to the amount of smoke inhalation he was experiencing. Officers attempted to convince Farris to at least open windows and doors to better ventilate his apartment. During the negotiations, FFD personnel were forced to suppress sporadic fires from the apartment from a distance since Farris had made threats that he was armed with a firearm,” FPD wrote.

Negotiations continued until 2:53 p.m. when officers reached Farris in the apartment. Farris refused to comply with officers and a struggle occurred, police said.

“Farris was then taken into custody and officers walked him outside. As Farris was receiving medical attention, he had an emergency medical episode,” FPD wrote.

Farris was transported to a hospital in critical condition.

Farris’ condition deteriorated over the next day and on May 22 he was removed from life-support.

The Alameda County Coroner’s Office responded to the hospital to take over the death investigation.

The coroner has not yet determined Farris’ cause of death.