A strong earthquake shook parts of Pakistan and Afghanistan early Saturday, rattling buildings and forcing sleeping residents out of their homes.

More than 30 people were injured as houses or walls collapsed in the northwestern Pakistan city of Peshawar, said emergency rescue service spokesman Bilal Ahmed Faizi. A total of 41 people were taken to hospitals in the city, according to doctors and rescue officials.

Pakistani official Ghulam Rasool told The Associated Press that the magnitude-6.9 quake was centered in Tajikistan near the Afghan border, beginning after midnight and lasting for 59 seconds.

However, the U.S. Geological Survey reported that the quake measured at magnitude 6.2 and was centered in the Hindu Kush region of Afghanistan. Twitter users in the Afghan capital, Kabul, reported feeling the tremors.

Hamid Nawaz, the head of Pakistan's disaster management authority, said they were still assessing damage. He confirmed that some old homes and walls collapsed in Peshawar, but he refused to share further details.

Some people panicked and ran out of their homes in New Delhi and other parts of northern India. But there were no immediate reports of fatalities or major property damage, the Press Trust of India news agency reported.

The quake was also felt in the Kashmir region. In Pakistan's capital, Islamabad, some residents remained outside their homes despite the chilly winter weather, fearful of aftershocks.

Sahiba Khan, an 18-year-old student, said she was reading when the earthquake jolted her home. All of her family members emerged, reciting verses from the Quran.