The epicentre of the earthquake was located in Afghanistan near the border with Pakistan and Tajikistan and at a depth of 232.4 kilometres, the US Geological Survey said.
Tremors were felt for over five seconds in Peshawar, Nowshera, Charsadda, Mardan, Swat and Bajour.
The intensity of the earthquake was higher in Mardan, Buner, Swabi and Malakand divisions of Khyber Pakhtunkhwa as compared to provincial capital Peshawar, the Dawn reported.
There were no reports of casualties to men and damage to property.