Indonesia's meteorology and geophysics agency (BMKG) has lifted the tsunami alert issued after a 7.1-magnitude earthquake south of the island of Java.
The tremor struck shortly after 0300 on Monday (2000 GMT on Sunday), about 300km (186 miles) south-west of Cilacap at a depth of 10km, the agency said.
Thousands of people poured out of their homes and ran to high ground, witnesses told an Indonesian radio station.
There have so far been no reports of any casualties or damage.
The BMKG's technical chief said the shaking from Monday's earthquake had been felt in the Pangandaran and Cilacap districts of central Java.
"This quake roused people from their sleep," said Suharjono.
Those who received the tsunami alert SMS message from the agency were asked to warn others of the potential danger.
State energy firm Pertamina said its refinery in Cilacap was not damaged.
Indonesia is located on the Pacific "Ring of Fire", an arc of volcanoes and fault lines encircling the Pacific Basin.