Rescuers are digging with their bare hands through the debris of buildings brought down by a powerful earthquake that killed more than 400 people in the once-contested mountainous border region between Iraq and Iran.

Sunday night’s magnitude 7.3 earthquake struck about 19 miles outside the eastern Iraqi city of Halabja, according to the most recent measurements from the US Geological Survey.

The worst damage appeared to be in the Kurdish town of Sarpol-e-Zahab in the western Iranian province of Kermanshah, which sits in the Zagros Mountains that divide Iran and Iraq.

Residents fled into the streets as the quake struck, without time to grab possessions, as apartment complexes collapsed into rubble.

Residents dug frantically through wrecked buildings for survivors, and firefighters from Tehran joined other rescuers in the desperate search, using dogs to inspect the rubble.

The hospital in Sarpol-e-Zahab was heavily damaged, and the army set up field hospitals, although many of the injured were moved to other cities including Tehran.

The tremor also damaged an army garrison and buildings in the border city and killed an unspecified number of soldiers, according to reports.

Graphic locates epicentre of 7.3-magnitude earthquake on the border of Iran and Iraq
(PA graphic)

Iran’s Supreme Leader Ayatollah Ali Khamenei immediately dispatched all government and military forces to aid those affected.

Many of the heavily damaged complexes in Sarpol-e-Zahab were part of construction projects under former hardline president Mahmoud Ahmadinejad.

The quake killed 407 people in Iran and injured 7,156 others, crisis management spokesman Behnam Saeedi told state TV. Most of the injuries were minor, he said, with fewer than 1,000 still in hospital.

The semi-official Tasnim news agency reported 445 dead and 7,370 injured. There was no immediate explanation of the discrepancy, although double-counting of victims is common during such disasters in Iran.

A rescue worker searches debris for survivors with his sniffer dog (Pouria Pakizeh/ISNA via AP)
A rescue worker searches debris for survivors with his sniffer dog (Pouria Pakizeh/ISNA via AP)

The official death toll came from provincial forensic authorities based on death certificates issued. Some reports said authorities have warned that unauthorised burials without certification could mean the death toll was higher.

In Iraq, the earthquake killed at least seven people and injured 535, all in the country’s northern, semi-autonomous Kurdish region, according to its Interior Ministry.

The earthquake struck 14.4 miles below the surface, a shallow depth that can cause broader damage. Magnitude 7 earthquakes on their own are capable of widespread, heavy damage.

The quake caused Dubai’s skyscrapers to sway and could be felt 660 miles away on the Mediterranean coast. Nearly 120 aftershocks followed.

Destroyed buildings and a car are seen after an earthquake at the city of Sarpol-e-Zahab in western Iran
(Pouria Pakizeh/AP)

Ayatollah Khamenei offered his condolences as President Hassan Rouhani’s office said Iran’s elected leader would tour the damaged areas on Tuesday, which was declared a national day of mourning.

Authorities also set up relief camps and hundreds lined up to donate blood in Tehran, though some on state TV complained about the slowness of aid coming.

Sarpol-e-Zahab fell to the Iraqi troops of dictator Saddam Hussein during his 1980 invasion of Iran, which sparked the eight-year war between the two countries that killed a million people. Though clawed back by Iran seven months later, the area remained a war zone that suffered through Saddam’s missile attacks and chemical weapons.

After the war, Iran began rebuilding the town. It also was part of Mr Ahmadinejad’s low-income housing project, which aided the hardliner’s populist credentials but also saw cheap construction.