The US Geological Survey said a magnitude 6 earthquake struck just before midnight local time in eastern Afghanistan near the border with Pakistan.