Medical volunteers rushed in fading evening light to get people to hospitals, which were straining to cope with the influx of injured.
The Aceh provincial government said in a statement 93 people had died and more than 500 were injured, many seriously.
Sutopo Nugroho of Indonesia's national disaster management agency, said a state of emergency had been declared in Aceh, which sits on the northern tip of Sumatra island.
"We are now focusing on searching for victims and possible survivors," said Nugroho. His agency put the death toll at 94.
Aceh was devastated by a massive earthquake and tsunami centered on its western coast near the provincial capital, Banda Aceh, on Dec. 26, 2004. That tsunami killed 226,000 people along Indian Ocean shorelines.
Officials urged people to sleep outdoors as twilight fell, in case aftershocks caused more damage to already precarious buildings.
President Joko Widodo was expected to visit the area on Thursday, his deputy told media.
Wednesday's quake hit the east coast of the province, about 170 km (105 miles) from Banda Aceh. Nugroho said Aceh's Pidie Jaya regency, with a population of about 140,000, was worst hit.
Many victims had suffered broken bones and gashes and had to be treated in hospital corridors and hastily erected disaster tents, a Reuters witness said.
Television showed footage of flattened mosques, fallen electricity poles and crushed cars.
A Red Crescent volunteer said health workers were struggling.
"There aren't enough medical staff," the Red Crescent's Muklis, who like many Indonesians uses one name, told TVOne.
Nugroho said more than 1,000 personnel, including military officers and volunteers, had been deployed to help in disaster relief.
The U.S. Geological Survey said the quake struck just after 5 a.m. (2200 GMT Tuesday) at a depth of 17 km (11 miles). No tsunami warning was issued.
At least five aftershocks were felt after the initial quake, the disaster management agency said.
The region suffered massive destruction in 2004 when a 9.2 magnitude quake triggered a tsunami that wiped out entire communities in Indonesia and other countries around the Indian Ocean.
Indonesia was the hardest hit, with more than 120,000 people killed in Aceh.
Nearly 300 crocodiles were slaughtered in revenge killings by a mob in Indonesia over the weekend. The incident happened shortly after the funeral of a man in his 40s who himself was killed by a crocodile in the Indonesian state of West Papua.
4 years, 8 months ago
Something has washed up on the shore of an Indonesian island. It's huge, it's floating — and it's rotting. A large 15m (49.2 ft) long sea creature was discovered off Hulung Beach, on Seram Island, Indonesia.
5 years, 10 months ago