A powerful earthquake struck Indonesia’s main island of Java on Monday, killing at least 162 people, injuring hundreds more and shaking tall buildings in the capital, Jakarta, 96 kilometers away. Many people were believed to be still trapped beneath the rubble, leading to fears that the death toll would sharply increase.

The magnitude 5.6 earthquake — which struck near the city of Cianjur, one of the most disaster-prone districts in Indonesia — caused the collapse of hundreds of buildings and triggered landslides that prevented many people from reaching the city’s main hospital.

Emergency workers and others scrambled overnight to find people trapped in the debris. But rescue efforts were hampered because the hospital itself was damaged and had lost electrical power, said Herman Suherman, a government official in Cianjur.