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

The afternoon quake hit offshore about 45 kilometres southwest of Malang city in East Java, damaging hundreds of homes as well as schools, government offices and mosques across the region.

"Our latest data shows that seven people died, two are seriously injured and 10 others sustained minor injuries," said National Disaster Mitigation Agency spokesman Raditya Jati.

Several communities had been evacuated, he added.

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

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.

"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."

Workers clear debris from the hall of a local parliament building in Blitar, after a 6.0 magnitude earthquake struck off the coast of Java island Workers clear debris from the hall of a local parliament building in Blitar, after a 6.0 magnitude earthquake struck off the coast of Java island Photo: AFP / M. ULIN NUHA

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 this week.

Indonesia experiences frequent quakes and volcanic eruptions due to its position on the Pacific "Ring of Fire", an arc of intense seismic activity where tectonic plates collide that stretches from Japan through Southeast Asia and across the Pacific basin.

Among Indonesia's string of deadly quakes was a devastating 2004 tremor measuring 9.1 magnitude that struck off the coast of Sumatra and triggered a tsunami that killed 220,000 throughout the region, including about 170,000 in Indonesia.

The Boxing Day disaster was one of the deadliest natural disasters in recorded history.

In 2018, a powerful quake shook the island of Lombok and several more tremors followed over the next couple of weeks, killing more than 550 people on the holiday island and neighbouring Sumbawa.

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

In 2006, a 6.3-magnitude quake rocked a densely populated region of Java near the city of Yogyakarta, killing around 6,000 people and injuring tens of thousands more.

A year earlier, a quake measuring 8.7 magnitude struck off the coast of Sumatra, which is particularly prone to quakes, killing 900 people and injuring about 6,000.