A strong earthquake has struck the Indonesian capital and other cities on the country’s most populous island, Java, killing an unknown number of people.

There were reports of collapsed buildings, and authorities issued a tsunami warning for parts of Java’s coastline after the quake struck just before midnight (1700 GMT) on Friday. People ran into the street in panic 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 a National Disaster Mitigation Agency spokesman, Sutopo Purwo Nugroho.

He also said there were reports that buildings had collapsed in the city of Tasikmalaya in western Java and in several western Java districts.

Nugroho said strong tremors had been felt for about 20 seconds in Jakarta and in cities and villages in western and central Java.

The US Geological Survey said the earthquake had a magnitude of 6.5 and that its centre was about 91 kilometres (56 miles) deep and located inland. Indonesian authorities reported a quake of similar magnitude off the shores of Java.

Indonesia sits on the Pacific “ring of fire” and has frequent earthquakes and volcanic eruptions.

Motorists are stuck in traffic as they try to reach higher ground amid fears of a tsunami, following an earthquake in Cilacap, Central Java.