LAHORE, Pakistan — A 5.6 magnitude earthquake rocked several cities in northern Pakistan and parts of the Kashmir region under its control, leaving at least 22 people dead and more than 700 wounded, officials said Tuesday.

The strong tremors, which struck just after 4 p.m. on Tuesday and lasted for several seconds, shook buildings and houses, causing panicked people to pour out into roads and streets. In Lahore, Pakistan’s second-largest city, people scrambled out of buildings, many praying out loud.

“Our focus will be on the rescue operation in the next couple of days,” Lt. Gen. Muhammad Afzal, the chairman of the National Disaster Management Authority, said during a news conference in Islamabad, the capital. “After that we will start the relief and repatriation efforts.”

The earthquake brought back painful memories of the magnitude 7.6 earthquake that struck the same region in October 2005 and left more than 75,000 people dead and hundreds of thousands homeless.

