One social media video showed panicked guests dashing out past a hotel swimming pool on Java island.

A powerful earthquake struck off the Indonesian islands of Sumatra and Java on Friday, triggering a two-hour tsunami warning that sent coastal-dwellers fleeing to higher ground and panicking people in the capital Jakarta.

The U.S Geological Survey put the epicentre in the Indian Ocean about 227 km (141 miles) from Teluk Betung city on Sumatra with an initial magnitude of 7 that was later lowered to 6.8.

There appeared to be no major damage or casualties, but strong tremors were felt in Jakarta, the capital, prompting people to run out of office buildings.

"It was so scary," said Gustiani Pratiwi, carrying two children out of an apartment block in Jakarta after feeling the quake strongly.

Indonesia is situated on the so-called Pacific Ring of Fire, which is frequently hit by earthquakes and sometimes accompanying tsunamis.

The most devastating in recent Indonesian history was on Dec. 26 in 2004, when a magnitude 9.5 quake triggered a massive tsunami that killed around 226,000 people along the shorelines of the Indian Ocean, including more than 126,000 in Indonesia.

Indonesia's geophysics agency issued a warning of potential tsunami waves up to three metres (10 feet) but that was withdrawn once the risk was discounted.

TV footage showed passengers at Jakarta's international airport rushing out of a terminal building, but authorities later said the airport was operating normally.

The quake could also be felt in other cities such as Yogyakarta on Java island.

One social media video showed panicked guests dashing out past a hotel swimming pool on Java island.

Last year, a tsunami hit the city of Palu in Sulawesi island, killing thousands, while a crater collapse at the Anak Krakatau volcano triggered a tsunami that killed at least 430 people in an area near the latest quake.