A strong aftershock nearly three hours later sparked a new wave of panic. Indonesia's government responded by issuing a fresh tsunami warning.
Some residents were crying in Aceh, where memories of a 2004 tsunami that killed 170,000 people in the province alone, are still raw. Others screamed "God is great" as they poured from their homes or searched frantically for separated family members.
The U.S. Geological Survey said the first 8.6-magnitude quake was centered 20 miles (33 kilometers) beneath the ocean floor around 269 miles (434 kilometers) from Aceh province.
That prompted the Pacific Tsunami Warning Center in Hawaii to issue a tsunami watch for Indonesia, India, Sri Lanka, Australia, Myanmar, Thailand, the Maldives and other Indian Ocean islands, Malaysia, Pakistan, Somalia, Oman, Iran, Bangladesh, Kenya, South Africa and Singapore.
A wave measuring less than 30 inches (80 centimeters) high, rolled to Indonesia's coast. There were no other signs of serious damage.
But just as the region was sighing relief, an 8.2-magnitude aftershock hit.
"We just issued another tsunami warning," Prih Harjadi, from Indonesia's geophysics agency, told TVOne in a live interview.
People along the western coast of Sumatra island and the Mentawai islands were told to stay clear of coasts.
The Pacific Tsunami Warning Centers watch remained in effect. A tsunami watch means there is the potential for a tsunami, not that one is imminent.
The initial quake was a strike-slip, not a thrust quake, according to experts. In a strike slip quake, the earth moves horizontally rather than vertically and doesn't displace large volumes of water.
They were still analyzing the aftershock.
"When I first saw this was an 8.7 near Sumatra, I was fearing the worst," Roger Musson, seismologist at the British geological survey who has studied Sumatra's fault lines, noting one of the initial reported magnitudes for the quake. "But as soon as I discovered what type of earthquake it was, then I felt a lot better."
The first tremor was felt in Malaysia, where it caused high-rise buildings to shake for about a minute, and in Singapore, Thailand, Bangladesh and India.
It caused chaos in the streets of Aceh. Patients poured out of hospitals, some with drips still attached to their arms. In some places, electricity was briefly cut.
Hours after the temblor, people were still standing outside their homes and offices, afraid to go back inside.
"I was in the shower on the fifth floor of my hotel," Timbang Pangaribuan told El Shinta radio from the city of Medan. "We all ran out. ... We're all standing outside now."
He said one guest was injured when he jumped from the window of his room.
Thailand's National Disaster Warning Center issued an evacuation order to residents in six provinces along the country's west coast, including the popular tourist destinations of Phuket, Krabi and Phang-Nga.
India's Tsunami Warning Center issued a warning for parts of the eastern Andaman and Nicobar islands. In Tamil Nadu in southern India, police cordoned off the beach and used loudspeakers to warn people to leave the area.
The quake was felt in Dhaka, Bangladesh, where many people in the city's commercial Motijheel district left their offices and homes in panic and ran into the streets. No damage or causalities were reported.
In Male, the capital of the Maldives, buildings were evacuated.
Indonesia straddles a series of fault lines that makes the vast island nation prone to volcanic and seismic activity.
A giant 9.1-magnitude quake off the country on Dec. 26, 2004, triggered a tsunami in the Indian Ocean that killed 230,000 people, most of them in Aceh.BANDA ACEH, Indonesia (AP) -- A massive earthquake off Indonesia's western coast triggered tsunami fears across the Indian Ocean on Wednesday, sending residents in coastal cities fleeing to high ground in cars and on the backs of motorcycles.