Photos and video carried by local media showed dozens of collapsed buildings and homes, uprooted trees and cracks in roads large enough to swallow cars in Mirpur, a town on Pakistan's side of the disputed territory of Kashmir near India.
Muhammad Safdar, 60, who lives near Mirpur, said he was in his house when it suddenly started shaking.
"We saw walls and the roof developing cracks and ceiling fans and other articles falling down, and we rushed out into an open field," he told Reuters by telephone. "I have never seen such a devastating earthquake in this area in my life."
Ramzan Ahmad, 65, who suffered a head injury and bleeding nose, said that he was with his family of seven when his house collapsed.
"We all got injuries," he said. "I saw dozens of houses razed on my way to hospital."
District commissioner Mohammad Tayyab, a local government official, and district police chief Irfan Saleem said 22 people were dead and nearly 200 injured.
Further away from the earthquake zone, the chief of Pakistan's National Disaster Management Authority, Lieutenant General Mohammad Afzal, said at a briefing in the capital Islamabad that he could confirm 10 deaths.
Army troops with aviation and medical support teams were dispatched, Major General Asif Ghafoor, a spokesman for the Pakistan Armed Forces, said in a tweet.
Rescue operations would take a day or two, Afzal said, adding that the disaster authority was distributing blankets, tents and kitchen sets to affected people.
"There are people who are stuck there and who need immediate help," Raja Farooq Haider, prime minister of Pakistan's Azad Kashmir region, told GNN TV. "We are putting in all our resources to get people the best of our help."
Most damage was in an area between Jhelum and Mirpur, said Afzal.
"Prime Minister Imran Khan expresses deep concern over the damage caused by the earthquake and directs all departments to provide immediate assistance," the Pakistan government said in a tweet.
The last major earthquake in Kashmir happened in 2005, killing more than 80,000 people.
The Himalayan region is divided between India, which rules the populous Kashmir Valley and the Hindu-dominated region around Jammu city, Pakistan, which controls a wedge of territory in the west, and China, which holds a thinly populated high-altitude area in the north.
The territory has been in dispute between India and Pakistan since partition in 1947, and the cause of two wars between the countries.