Rescuers are racing to pull dozens of students and workers from under the rubble of a school building that collapsed in East Java, Indonesia. Three people have been killed and 99 others hospitalized, some of them with critical injuries, officials said Tuesday, adding that the death toll may rise.

At least 38 others, many of them teenage boys, remain trapped under the Al Khoziny Islamic Boarding School in the East Java town of Sidoarjo. They had gathered for prayers when the building gave way on Monday.

The two-storey building had an unstable foundation and could not support the weight of the construction of two more floors, according to the disaster mitigation agency.

The girls were praying in another part of the building and managed to escape, according to the Associated Press. Students in the school are between the ages of 12 and 17.

Authorities say the building has taken on a pancake-like structure with layers of concrete slabs leaving only narrow voids, making rescue difficult. Footage on local media show the collapsed part of the building completely sunken in, with large slabs of concrete sticking out.

Authorities have suspended rescue operations temporarily due to risks of further collapses. The building's structure complicates the use of heavy equipment, raising safety concerns for any survivors still trapped within.

Heart-wrenching testimonies emerge from survivors, detailing narrow escapes amid chaos as the building crumbled. The regent of Sidoarjo noted that the school's management had not acquired the necessary permits for the construction expansion, raising questions about regulatory oversight in Indonesia's construction industry, which has a poor safety record.