The quakes hit four villages in the high mountains of the eastern province of Nangarhar, about 30 miles from theborder.
Shafiqullah from the village of Bhezad Kheil said 21 people were buried in a cemetery, including two of his young neighbors. Nijad, 10, and Sima, 7, both died after the roof above their second-story bedroom collapsed, raining down wood beams and chunks of mud, he said.
"There were two shakes," said Shafiqullah, 30. "The first shake was very strong, when everyone was asleep. The first shake destroyed everything. Then the crying and the shouting started."
The quakes destroyed or damaged an estimated 100 houses in the four villages in Sherzad district, about 50 miles east of Kabul, said governor's spokesman Ahmad Zia Abdulzai.
The U.S. Geological Survey said Nangarhar province was hit by two earthquakes - a 5.5 magnitude quake at about 2 a.m., and a 5.1 magnitude aftershock two hours later.
A villager in Sherzad, Shah Mohammad Khan, told The Associated Press that 40 people were killed and 60 wounded, but government officials had not confirmed those figures.
Afghanistan's Hindu Kush mountain range is hit by dozens of minor earthquakes each year. Many Afghan homes are made of dried mud, so even moderate earthquakes can cause many deaths and major damage to infrastructure.
Ambulances from the Afghan Red Crescent Society helped ferry the wounded from the remote earthquake site, reachable only after hours of travel on bumpy dirt roads.
U.S. forces stationed in the region also were standing by to assist if the Afghan government requested help, said spokeswoman Capt. Elizabeth Mathias.