DENPASAR, Indonesia — An earthquake shook Bali and other Indonesian islands Tuesday, causing panic and damaging homes and injuring one person.

It was the second strong earthquake in Indonesia since Sunday, when a quake in North Maluku province killed four people and damaged nearly 1,000 houses. About 3,100 people in the province are living in temporary shelters, disaster officials said.

Tuesday's magnitude 5.7 quake was centered at sea 82 kilometers (51 miles) to the southwest of Denpasar on Bali at a depth of 91 kilometers (57 miles), the U.S. Geological Survey said. Indonesia's geophysics agency said the quake didn't have the potential to cause a tsunami.

The national disaster agency said one person was injured in Bali and 38 buildings including houses and a Mercure hotel had minor damage.

It posted photos on its Twitter account showing a damaged house and mosque in Banyuwangi in East Java and a damaged Hindu temple in Bali. Video showed damage to an ornate entranceway in Nusa Dua, an area of high-end resorts in Bali.

The main hospital in Denpasar evacuated patients, some attached to intravenous drips, to the hospital grounds, television video showed. Numerous schools and hotels were also evacuated.

"While having breakfast suddenly everything in the room swayed very strongly," said George Stephen, an Australian holidaying in Bali's Kuta area.

He said guests fled the hotel in panic but returned after about 15 minutes.

Indonesia, with more than 260 million people, is prone to earthquakes and volcanic eruptions due to its location along the Pacific "Ring of Fire." A powerful Indian Ocean quake and tsunami in 2004 killed a total of 230,000 people in a dozen countries, most of them in Indonesia.