There were no reports of major damage but Kabul police chief General Baba Jan said one man died when he rushed out a window because of the earthquake, which measured 6.8 on the Richter scale.
"One person... a resident of Balkh province who was living in the Baba-e-Wali hotel jumped out of the window from the third floor and died in the hospital," Baba Jan said.
Deputy spokesman for President Hamid Karzai, Hamid Elmi, confirmed that one person had died in Kabul. There was some minor damage to buildings in northern Badakhshan province but no further casualties, he said.
The epicentre was located 200 kilometers underground deep in the Hindu Kush range straddling the Afghan-Pakistani frontier, some 450 kilometresmiles) north of the Pakistani capital Islamabad and 270 kilometers (167 miles) northeast of the Afghan capital Kabul.
"An earthquake measuring 6.8 on Richter scale was recorded in our observatory at 2:24 am (2124 GMT)," an official from Pakistan's Meteorological Department told AFP.
Islamabad residents were woken in the pre-dawn dark by a series of strong vibrations that shook beds, floors and walls for up to one minute.
The Pakistani official said although the quake was high in intensity, its underground focus meant it was unlikely to have caused much damage.
The tremors were felt in the northern Pakistani cities of Chitral, Rawalpindi, Peshawar, Gilgit and Abbottabad and as far east as Lahore.
In Afghanistan the jolts were so powerful that people fled their homes, witnesses said.
The quake was the strongest to be felt in Afghanistan since March 2002 when 800 people were killed and thousands rendered homeless in the northern province of Baghlan.
In northern Pakistan a less powerful earthquake measuring 5.5 in February killed 24 people.