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.
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.
Associated Press writer Niniek Karmini in Jakarta, Indonesia, contributed to this report.