The epicentre of the quake was in the Hindukush mountain ranges near Tajikistan border at a depth of 144 kilometres, an official of the Pakistan Meteorological Department said.
The tremor was felt in Malakand, Swat, Upper and Lower Dir districts of the province. "So far no loss to life or property has been reported," the official said.
The quake came days after a powerful earthquake jolted Nepal and neighbouring areas in China and India.
The quake left a trail of devastation in the region with thousands dead and scores injured.
Pakistan had suffered a 7.7-magnitude quake in 2013 which hit southwestern Balochistan province and killed about 500 people. However, Pakistan's worst quake was in 2005 when a 7.6 tremor killed more than 73,000 people.