A fire tore through a prison north of El Salvador's capital Wednesday, killing at least 16 young inmates and injuring 22.

Ten of the injured are listed in serious condition with burns, said Mauricio Ventura, director of the Rosales Hospital in the capital, San Salvador.

The small prison in the city of Ilobasco held 96 inmates, 43 of whom were in the cell block affected by the fire. A final count of the inmates showed five were not injured.

Most of the prisoners had served time in facilities for youthful offenders and were transferred to Ilobasco after they turned 18 to serve out any remaining sentences.

Initial reports indicate the fire was accidental and may have been caused by an electrical short circuit, said Red Cross Spokesman Carlos Lopez Mendoza. Police said they were still investigating the cause of the blaze.

"When the fire started, the young men were still in their cells, and some were asleep," Lopez Mendoza said.

Inmates confirmed the cause as a short circuit in interviews with the local news media. They said it started early in the morning and that the fire quickly spread to the prisoners' bedding. Some claimed that guards had been slow to respond to the fire.

Police took charge of guarding the inmates who remained in the prison following the fire.

In September, a law took effect in El Salvador making membership in a street gang punishable by four to six years in prison. Gang leaders face up to 10 years. Gangsters arrested for specific crimes also fill El Salvador's jails.

President Mauricio Funes introduced the law in July, a month after suspected members of the Mara 18 gang opened fire on a bus and set it ablaze, killing 17 people.

An estimated 20,000 Salvadorans belong to street gangs, which deal drugs and extort businesses.

(This version CORRECTS Corrects number of inmates in prison to 96 instead of 93. Lowers number of injured to 22 from 24; Raises number of those in serious condition from nine to 10. Updates headlines, photographs.)