The strong 6.1-magnitude quake left hundreds more injured as it rocked a region that was devastated by the quake-triggered tsunami of 2004.
The earthquake reduced houses in parts of Aceh to rubble, set off several landslides and badly damaged roads.
Rescuers were struggling to find the children still trapped after the mosque collapse in Blang Mancung village, Central Aceh district.
"Our search and rescue teams are struggling to evacuate an estimated 14 children still trapped under the rubble," Subhan Sahara, the head of the local disaster management agency, told AFP.
Also Read
The quake, which hit at a shallow depth of just 10 kilometres, injured more than 200 people and damaged more than 300 houses in Aceh, said national disaster agency spokesman Sutopo Purwo Nugroho.
As police and military personnel struggled to reach affected areas today, there were two aftershocks of more than 5.0 magnitude.
In a village in Bener Meriah district, one man was killed when a landslide engulfed a coffee plantation, said disaster agency official Fauzi.
Another four people died in hospitals in the district from injuries sustained in the quake, he said.
One of the fatalities was a child who died when a wall collapsed, Ema Suryani, a doctor at a health clinic in Lampahan city in the district, told AFP.
"We have received around 50 people with injuries sustained when the walls of their houses collapsed," added the doctor.