Islamabad - Tremors were felt in parts of northern India as well.
Media photos and video showed a collapsed building and cracks in roads large enough to swallow cars in Mirpur, a town on Pakistan-administered Kashmir near India.
District commissioner Mohammad Tayyab said eight people were killed, including three children. District police chief Irfan Saleem said more than 100 more suffered injuries.
"I am in the hospital right now and I am being told that several of the injured people are in a critical condition," he told Reuters by phone.
Major General Asif Ghafoor, a spokesman for the Pakistan Armed Forces, tweeted that army troops with aviation and medical support teams were dispatched.
"Our whole concentration right now is to accelerate the rescue operation," Raja Farooq Haider, prime minister of Pakistan's Azad Kashmir region, told GNN TV. "There are people who are stuck there and who need immediate help. We are putting in all our resources to get people the best of our help."
The quake struck 14 miles (23 km) north of Jhelum, Pakistan, at a relatively shallow depth of 10 km, the United States Geological Survey (USGS) reported.
Most damage was in an area between Jhelum and Mirpur, said the chief of Pakistan's National Disaster Management Authority, Lieutenant General Mohammad Afzal.
The last major earthquake in Kashmir happened in 2005, killing more than 80,000 people.
Jhelum is located in northeastern Pakistan roughly 120 km southeast of Islamabad.
Magnitude 5.8 #earthquake jolts parts of country, epicenter of the earthquake was 5km north of #Jehlum, while its depth was recorded as 10 km#APPNews #Kashmir #AJK #Mirpur
Latest footage from AJK @MoIB_Official @demp_gov @pid_gov @Dr_FirdousPTI pic.twitter.com/hIXLwepbbL
- APP (@appcsocialmedia) September 24, 2019