The quake struck at 11:47 p.m. and triggered a tsunami warning for parts of Java’s coastline that was lifted about two hours later.

Panicking people ran out of buildings in many areas and Indonesian television showed heavy traffic on roads as people fled coastal areas.

A 62-year-old man was confirmed dead in the Ciamis region of western Java and there were reports of more deaths and of injuries in the same region, said National Disaster Mitigation Agency spokesman Sutopo Purwo Nugroho.

He said buildings had collapsed and were damaged in several cities and towns of central and western Java.

“Houses and other buildings are damaged in many areas,” he said in a statement.

The earthquake had a magnitude of 6.5 and was about 91 kilometres (56 miles) deep and located just inland, the U.S. Geological Survey said.

Strong tremors were felt for about 20 seconds in the capital Jakarta and in other cities and towns, Nugroho said.

A hospital in the central Java town of Banyumas was damaged and patients were evacuated, Indonesia’s MetroTV reported.

The country sits on the “Pacific Ring of Fire” and has frequent earthquakes and volcanic eruptions.