At least six people were killed after a 6.0 magnitude quake struck off the coast of Indonesia's main Java island, its disaster agency said Saturday, as the country reels from a cyclone disaster in another part of the archipelago.

The afternoon temblor hit offshore about 45 kilometres southwest of Malang city in East Java.

"The agency has recorded six dead and one person who sustained serious injuries," said National Disaster Mitigation Agency spokesman Raditya Jati, adding that several villages in the region had been evacuated.

It was not clear if the death toll would rise, but the agency did not report anyone missing after the strong quake.

The quake struck at a relatively deep 82 kilometres (50 miles) -- shallower quakes tend to do more damage than deep ones.

Images from the scene showed a ceiling caved in at a hospital ward and debris strewn across the floor of the local parliament in Blitar, a city southwest of Malang.

A ceiling caved in at a hospital ward in Blitar, after a 6.0 magnitude earthquake struck off the coast of Indonesia's Java island A ceiling caved in at a hospital ward in Blitar, after a 6.0 magnitude earthquake struck off the coast of Indonesia's Java island Photo: AFP / AVIAN

"I had just finished praying and was changing my clothes when suddenly the quake struck," Malang resident Ida Magfiroh told AFP.

"It was pretty strong and went for a long time. Everything was swaying... My heart was racing."

The deadly quake comes as the Southeast Asian nation reels from a cyclone that killed more than 200 people in the eastern part of the archipelago and neighbouring East Timor.

Indonesia experiences frequent seismic and volcanic activity due to its position on the Pacific "Ring of Fire", where tectonic plates collide.

In 2018, a 7.5-magnitude quake and a subsequent tsunami in Palu on Sulawesi island left more than 4,300 people dead or missing.

On December 26, 2004, a devastating 9.1-magnitude earthquake struck off the coast of Sumatra and triggered a tsunami that killed 220,000 throughout the region, including around 170,000 in Indonesia.

It was one of the deadliest natural disasters in recorded history.