A strong earthquake hit off the west Indonesian coast in the Indian Ocean on Tuesday, slightly damaging several buildings but causing no injuries, officials said.

The magnitude 6.2 quake was centered in the sea at a depth of 20 kilometers (12 miles) about 17 kilometers (10 miles) southwest of the town of Sinabang in Aceh province, the U.S. Geological Survey reported.

Rahmat Triyono, who heads the earthquake and tsunami center at Indonesia's Meteorology, Climatology and Geophysics Agency, said there was no risk of a tsunami from the quake.

National Disaster Mitigation Agency spokesman Agus Wibowo said the quake caused cracks or broken windows in several buildings in Sinabang, but no injuries were reported.

Residents in parts of Aceh and neighboring North Sumatra province felt a moderate tremor for a few seconds, while people in the Aceh provincial capital of Banda Aceh did not feel the quake, Wibowo said.

Indonesia, home to 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, and Aceh province, which was closest to the earthquake, was hit first and hardest. More than 170,000 people died in Indonesia alone, about three-quarters of the overall death toll.