Many children among Indonesia quake dead

Many children killed when their schools collapsed are among the 252 dead from an earthquake that devastated a town on Indonesia's main island of Java, officials say, as rescuers race to reach people trapped in rubble.

Hundreds of people were injured in the Monday quake and officials warned the death toll was likely to rise.

The shallow 5.6-magnitude quake struck in mountains in Indonesia's most populous province of West Java, causing significant damage to the town of Cianjur and burying at least one village under a landslide.

Landslides and rough terrain were hampering rescue efforts, said Henri Alfiandi, head of National Search and Rescue Agency (Basarnas).

"The challenge is the affected area is spread out ... On top of that, the roads in these villages are damaged," Alfiandi told a news conference, adding that more than 13,000 people had been evacuated.

"Most of the casualties are children because at 1pm they were still at school," he said, referring to the time the quake hit.

Many of the fatalities resulted from people being trapped under collapsed buildings, officials said.

President Joko Widodo flew in to Cianjur on Tuesday to encourage rescuers.

"My instruction is to prioritise evacuating victims that are still trapped under rubble," said the president.

He offered his condolences to the victims and pledged emergency government support. Reconstruction should include earthquake-proof housing, he said.

Survivors gathered overnight in a Cianjur hospital car park. Some of the injured were treated in tents, others were hooked up to intravenous drips on the pavement as medical workers stitched up patients under torch light.

"Everything collapsed beneath me and I was crushed beneath this child," Cucu, a 48-year-old resident, told Reuters.

"Two of my kids survived, I dug them up ... Two others I brought here, and one is still missing," she said through tears.

"Many dead bodies are lying in the hospital grounds. It's very crowded," said her relative, Hesti.

Footage from Kompas TV showed people holding cardboard signs asking for food and shelter, with emergency supplies seemingly yet to reach them.

Hundreds of police officers were deployed to help the rescue effort.

"Today's main task order for personnel is to focus on evacuating victims," Dedi Prasetyo, national police spokesperson told the Antara state news agency.

The death toll from the earthquake had risen to 252, the district government said in a post on social media. The death toll from the national disaster agency (BNPB) stood at 103, with 31 missing.

Cianjur police chief told Metro TV that 20 people had been evacuated from the district of Cugenang, most of whom had died, with residents reporting missing family members.

The area was hit by a landslide triggered by the quake that had blocked access to the area.

Rescue efforts were complicated by electricity outages in some areas, and more than 100 aftershocks.

Straddling the so-called Ring of Fire, a highly seismically active zone where different plates on the earth's crust meet, Indonesia has a history of devastating earthquakes.