A strong, shallow earthquake has toppled buildings and collapsed walls on Indonesia’s densely populated main island of Java, killing at least 162 people and injuring hundreds more.

Emergency workers treated the injured on stretchers and blankets outside main hospitals, on terraces and in car parks after the magnitude 5.6 tremor.

Many casualties included children, some of whom were resuscitated while others were given oxygen masks.

Residents, some crying with children in their arms, fled damaged homes after the quake shook the Cianjur region in West Java province at a depth of 6.2 miles. The tremor also caused panic in the greater Jakarta area, where high-rises swayed with many being evacuated.

Rescue teams and civilians in Cianjur were looking for others who may have been buried in the debris of collapsed brick houses. The quake was powerful enough to bring down walls, chunks of concrete and roof tiles, some of which landed inside bedrooms.

West Java Governor Ridwan Kamil said the number of confirmed dead had risen to 162.

Indonesia Earthquake
Rescuers search for survivors at the ruins of houses damaged by an earthquake in Cianjur, West Java, Indonesia (AP)

“The majority of those who died were children,” he said. Many were public school students who had finished their regular classes and were taking extra lessons at Islamic schools, he said.

Kamil said more than 13,000 people whose homes had been heavily damaged were being taken to evacuation centres.

Around 700 people were injured, said National Disaster Mitigation Agency chief Suharyanto said.

Several landslides were reported around Cianjur. Among the dozens of buildings that were damaged was an Islamic boarding school, a hospital and other public facilities, the agency said.

Most of the victims and survivors were taken to the government hospital in Cianjur, where emergency tents were erected and workers treated the injured.

Indonesia’s Meteorology, Climatology, and Geophysical Agency recorded at least 25 aftershocks.

Indonesia Earthquake
Workers inspect a store damaged during the quake (AP)

Earthquakes occur frequently across the sprawling archipelago nation, but it is uncommon for them to be felt in Jakarta.

The country of more than 270 million people is frequently struck by earthquakes, volcanic eruptions and tsunamis because of its location on the Ring of Fire, an arc of volcanoes and fault lines in the Pacific Basin.

In February, a magnitude 6.2 earthquake killed at least 25 people and injured more than 460 in West Sumatra province. In January 2021, a magnitude 6.2 earthquake killed more than 100 people and injured nearly 6,500 in West Sulawesi province.

A powerful Indian Ocean quake and tsunami in 2004 killed nearly 230,000 people in a dozen countries, most of them in Indonesia.

Injured people
People injured during an earthquake receive medical treatment (AP)