A strong earthquake hit off Indonesia's main island of Java early Monday, prompting authorities to briefly issue a tsunami warning that sent thousands of residents fleeing to higher ground.
There were no immediate reports of injuries or damage.
Following the tsunami warning, many in the town of Cilacap, closest to the quake's epicenter, poured into the grand mosque. When word finally came that the threat of a big wave had passed, they erupted in cheers, embraced one another or fell to their knees in thanks.
"We were very scared after seeing what happened in Japan _ and also Aceh, of course," said Sukitno, a resident. "But God listened to our prayers. He spared us!"
The U.S. Geological Survey said the magnitude-6.7 quake that hit just after 3 a.m. was centered 200 miles (318 kilometers) off southern Java and 15 miles (24 kilometers) beneath the ocean floor.
Both Indonesia and Japan are prone to seismic upheaval due to its location on the so-called "Ring of Fire," an arc of volcanos and fault lines encircling the Pacific Basin.
A 2004 tsunami off Indonesia's westernmost province of Aceh killed 230,000 people in a dozen nations. Officials fear up to 25,000 may have died after last month's earthquake and tsunami in Japan.
Associated Press writer Niniek Karmini contributed to this report from Jakarta.