Survivors of an earthquake that flattened villages in eastern Afghanistan, killing more than 800 people, spent the night in the open as rescuers worked Tuesday to pull victims from the rubble.

The 6.0-magnitude earthquake struck just before midnight Sunday, with the worst of the destruction in Kunar province, which borders Pakistan.

Rescuers searched into the night to pull to safety those trapped under the debris of simple mud and stone homes built into steep valleys.