The magnitude-6.6 quake hit about 1 a.m. (1800 GMT Monday), waking people in towns and villages across Sumatra island's northern tip.
It was centered 60 miles (100 kilometers) southwest of the city of Medan and 62 miles (110 kilometers) beneath the earth's crust, according to the U.S. Geological Survey. It was too far inland to generate a tsunami.
Maura Sakti, a mayor in Subulussalam, told local station TVOne a 12-year-old boy had been killed. At least one other person was injured.
Boby Sigit, an official at the National Disaster Management, said later that two people were killed in Aceh -- the boy and a 60-year-old man -- while a 26-year-old mother died in North Sumatra's district of Dairi.
Hundreds of people were evacuated to temporary shelters as authorities surveyed the damage, said Lt. Col. Helmy Kesuma, police chief in the hard-hit town of Singkil.
Some electricity poles were knocked down there, crashing into homes and causing blackouts.
"My wife was screaming, my children crying," said Burhan Mardiansyah, 37, a Singkil resident. "We saw our walls start to crack and everything inside the house was falling. Thank God we're all safe."
The panic extended to Medan, the sprawling provincial capital of North Sumatra, where hundreds of patients from at least one hospital had to be evacuated, some in wheelchairs or with IVs attached to their arms.
Hotels emptied and residents ran into the streets or the balconies of their rented homes, clutching babies to their chests.
Fearing aftershocks, many refused to go back inside for hours.
Indonesia straddles a series of fault lines that makes the vast island nation prone to volcanic and seismic activity.
A giant quake off the country on Dec. 26, 2004, triggered a tsunami in the Indian Ocean that killed 230,000 people, half of them in Indonesia's westernmost province of Aceh.