A 4.4-magnitude earthquake stuck the Barjarnegara district in central Java, Indonesia. Photo: Badan Nasional Penanggulangan Bencana (Indonesian National Board for Disaster Management)

Two people were killed and at least 21 people injured in an earthquake that struck central Java in Indonesia on Wednesday afternoon.

The 4.4 magnitude quake hit Banjarnegara district in Central Java province at 1.28pm on Wednesday and damaged more than 300 buildings, The Straits Times reported.

Sutopo Purwo Nugroho, a spokesperson from the Natural Disaster Management Agency, said 316 houses, four mosques and two school buildings were damaged by the quake.

“The worst impacts were in Kalibening sub-district of Banjarnegara district as the unstable condition of the soil there has also worsened the risks,” Nugroho said.

Nugroho said more than 2,000 people had taken shelter in evacuation centers and around 200 soldiers and personnel were working on relief efforts in the affected areas.

“The wounded people have been rushed to a nearby health clinic for medical treatment and others have been evacuated,” he said.

Indonesia, which has a population 261 million spread over at least 17,000 islands, is located on the Ring of Fire – a string of volcanoes and sites of seismic activity around the edges of the Pacific Ocean.

There have been two slightly bigger quakes in that region since the one that rocked central Java yesterday afternoon, one of 5.3 magnitude at 4.25pm yesterday in the Banda Sea off the island of Ambon and a 4.7 magnitude quake near Komo in Papua New Guinea at about 5am today.

The last big quake to hit Java was a 6.1 magnitude tremblor off the southern coast in January that damaged more than 100 buildings in the capital Jakarta.