At least 39 people are dead in Pakistan's western province of Baluchistan after a powerful earthquake destroyed scores of houses in a remote mountainous area, an official says.

The chief spokesman for the country's National Disaster Management Authority, Mirza Kamran Zia, said most of the casualties occurred when houses collapsed on people inside.

Map showing location of Pakistani earthquake

Abdul Qadoos, deputy speaker of the Baluchistan assembly, had earlier said 30 people and at least 30 per cent of houses in the impoverished Awaran district had been destroyed.

People fled into the streets and prayed for their lives as buildings swayed, officials said.

The magnitude 7.7 quake hit in the southern part of Baluchistan province, said Pakistan's chief meteorologist, Mohammed Riaz. The U.S. Geological Survey in Golden, Colo., reported the quake as magnitude 7.8.‚Äč

The quake struck in a remote area of Baluchistan with little population, said the head of Pakistan's Earthquake Centre, Zahid Rafi. He warned of possible aftershocks.

The quake was felt in Pakistan's largest city, Karachi, along the Arabian Sea. People in the city's tall office buildings rushed into the streets following the tremor, and Pakistani television showed images of lights swaying as the earth moved.

"I was working on my computer in the office. Suddenly I felt tremors. My table and computer started shaking. I thought I am feeling dizziness but soon realized they were tremors," said one Karachi resident, Mohammad Taimur.

TV footage showed residents in Quetta, the capital of Baluchistan, coming out of their homes and offices in a panic. One man told Pakistan's Dunya television channel that he was sitting in his office when the building started shaking.

Other residents said people started reciting verses from Islam's holy book, the Quran, when the quake began.

Baluchistan and neighboring Iran are prone to earthquakes.

A magnitude 7.8, which was centered just across the border in Iran, killed at least 35 people in Pakistan last April.

In January 2011, a 7.2 magnitude quake damaged 200 mud-brick homes in a remote area of Baluchistan about 320 kilometres southwest of Quetta, not far from the Afghan border, but it caused no casualties.

With files from Reuters