ISLAMABAD -- A magnitude 6.5 earthquake rattled much of Pakistan and Afghanistan on Tuesday, sending panicked residents fleeing from homes and offices and frightening people in remote villages. At least 11 people died in the two countries.

More than 100 people were brought to hospitals in the Swat valley region of Pakistan's northwestern Khyber Pakhtunkhwa province in a state of shock, Bilal Faizi, a spokesman for Pakistan's emergency services told The Associated Press.

"These terrified people collapsed, and some of them collapsed because of the shock of the earthquake," he said. Faizi said most were later discharged from the hospital.

Faizi and other officials said nine people were killed when roofs collapsed in various parts of northwestern Pakistan. Dozens of others were injured in the quake, which was centered in Afghanistan and also felt in bordering Tajikistan. The earthquake triggered landslides in some of the mountainous areas, disrupting traffic.

Taimoor Khan, a spokesman for the provincial disaster management authority in the northwest, said at least 19 mudbrick homes collapsed in remote areas. "We are still collecting data about the damages," he said.

The powerful tremors sent many people fleeing their homes and offices in Pakistan's capital of Islamabad, some reciting verses from the Quran, Islam's holy book. Media reports suggested cracks had appeared in some apartment buildings in the city.

In Afghanistan, Sharafat Zaman Amar, Taliban's appointed spokesman for the public health ministry said, so far at least two people died and around 20 others were injured in the earthquake in Afghanistan.

Zaman Amar said "Unfortunately, there could be more casualties as the quake was so powerful, in most parts of the country" all hospitals and health facilities are ready to save lives of people, he added.

The scene was repeated in Kabul and other parts of Afghanistan.

"The quake was so strong and terrifying, we thought houses are collapsing on us, people were all shouting and were shocked," said Shafiullah Azimi, a Kabul resident.

Aziz Ahmad, 45, another Kabul resident, said "In my life this was first time I have experienced such powerful quake, everyone was terrified," He added he and all his neighbors stayed out of their homes for hours, afraid of aftershocks. "We couldn't dare to get back homes."

The U.S. Geological Survey said the epicenter of the magnitude 6.5 quake was 40 kilometres south-southeast of Jurm in Afghanistan's mountainous Hindukush region, bordering Pakistan and Tajikistan. The quake struck 188 kilometres deep below the Earth's surface, causing it to felt over a wide area.

Physician Rakhshinda Tauseed was at her hospital in the eastern Pakistani city of Lahore when the earthquake hit. "I quickly asked patients to go move to a safer place," she said.

Khurram Shahzad, a resident in Pakistan's garrison city of Rawalpindi, said he was having dinner with his family at a restaurant when the walls started swaying.

"I quickly thought that it is a big one, and we left the restaurant and came out," he told The Associated Press by phone. He said he saw hundreds of people standing on the streets.

The situation was similar in Peshawar, the capital of Khyber Pakhtunkhwa province on the border with Afghanistan, where people were seen standing outside their homes and offices.

Pakistani Prime Minister Shahbaz Sharif in a statement said he asked disaster management officials to remain vigilant to handle any situation.

Zabihullah Mujahid, the main spokesman for the Taliban government in Afghanistan, tweeted that the Ministry of Public Health had ordered all health centres to be on standby.

The region is prone to violent seismic upheavals. A magnitude 7.6 quake in 2005 killed thousands of people in Pakistan and Kashmir.

Last year in southeastern Afghanistan, a 6.1 magnitude quake struck a rugged, mountainous region, flattening stone and mud-brick homes. Afghanistan's Taliban rulers put the total death toll from the quake at 1,150, with hundreds more injured, while the UN has offered a lower estimate of 770.

------

Associated Press writers Rahim Faiez in Islamabad, Riaz Khan in Peshawar and Abdul Sattar in Quetta, Pakistan, contributed to this report.