JAKARTA, Indonesia — The death toll from a fire at an unregulated oil well in Indonesia's Aceh province rose to 22 on Thursday following the deaths of four more victims, officials said.

The head of the Aceh Disaster Mitigation Agency, Teuku Ahmad Dadek, said 37 people were still being treated at three hospitals, many with severe burns.

The newly drilled well in Pasir Putih village in eastern Aceh district exploded into flames early Wednesday when many people were trying to collect the gushing oil. Five nearby houses were engulfed by the inferno.

Dadek said the fire was finally extinguished early Thursday but that gas and a mixture of water and oil were continuing to spurt out. More than 50 families were evacuated from the area.

Dadek said two people died at a hospital in Banda Aceh, the provincial capital, and two others died while being taken to hospitals.

The National Disaster Mitigation Agency spokesman described the well as "traditional," likely meaning it had unclear ownership and was used by the local community.

Witnesses said many people had come to the village in recent days to collect oil from the gushing well.

Aceh, at the northern tip of the island of Sumatra, has significant commercially untapped natural gas reserves and is dotted with illegal wells.