The US Geological Survey put the epicentre near Jarm in the country's northeast, 250 kilometres (160 miles) from the capital Kabul and at a depth of 213.5 km.
The quake, which lasted at least one minute, shook buildings in Kabul, Islamabad and New Delhi, sending people rushing into the streets.