At least 530 people were killed in Iran and Iraq on Sunday when a powerful magnitude 7.3 earthquake hit the region, state media in the two countries said, as rescuers searched for dozens trapped under rubble. Thousands are reported injured.

Officials expected the casualty toll to rise when search and rescue teams reached remote areas of Iran.

A quake registering a magnitude between 7 and 7.9 can inflict widespread and heavy damage. Moreover, many houses in rural areas of Iran are made of mud bricks that can crumble easily in a quake.

People evacuate buildings in panic as 7.3 magnitude quake hits Iraq-Iran border Credit: Haaretz/Reuters

The earthquake was felt throughout the Middle East, with tremors being reported in Israel, but the province of Kermanshah in Iran was hit the hardest.

More than 142 of the victims were in Sarpol-e Zahab county in Kermanshah, about 15 kilometers (10 miles) from the Iraq border. The province has announced three days of mourning

The main hospital of the capital of the county was severely damaged and could not treat hundreds of injured people who were taken there, the head of the Iranian emergency services, Pirhossein Koulivand said.

Open gallery view A damaged storefront is seen after an earthquake in Halabja, Iraq, November 12, 2017. Credit: SOCIAL MEDIA/REUTERS

Open gallery view An earthquake victim is aided at Sulaimaniyah Hospital on November 12, 2017, in Sulaimaniyah, Iraq. Credit: SHWAN MOHAMMED/AFP

Open gallery view A child injured in the earthquake waits for aid at Sulaimaniyah Hospital on November 12, 2017, in Sulaimaniyah, Iraq. Officials in Iran reports at least 30 dead in that country. The US Geological Surv Credit: SHWAN MOHAMMED/AFP

Open gallery view An earthquake victim is aided at Sulaimaniyah Hospital on November 12, 2017, in Sulaimaniyah, Iraq. Officials in Iran reports at least 30 dead and Iraqi officials 6. The US Geological Survey said the Credit: SHWAN MOHAMMED/AFP

Dancing buildings

The U.S. Geological Survey said the quake measured magnitude 7.3. An Iraqi meteorology official put its magnitude at 6.5 with the epicentre in Penjwin in Sulaimaniyah province in the Kurdistan region close to the main border crossing with Iran.

Kurdish health officials said at least four people were killed in Iraq and at least 50 injured.

The quake was felt as far south as Baghdad, where many residents rushed from their houses and tall buildings when tremors shook the Iraqi capital.

"I was sitting with my kids having dinner and suddenly the building was just dancing in the air," said Majida Ameer, who ran out of her building in the capital's Salihiya district with her three children. "I thought at first that it was a huge bomb. But then I heard everyone around me screaming: 'Earthquake!'"

Similar scenes unfolded in Erbil, the capital of the Kurdistan Region, and across other cities in northern Iraq, close to the quake's epicentre.

The strong earthquake was also felt in central Israel. No damages or casualties were reported.

Cold weather

Electricity was cut off in several Iranian and Iraqi cities, and fears of aftershocks sent thousands of people in both countries out onto the streets and parks in cold weather.

The Iranian seismological centre registered around 50 aftershocks and said more were expected.

The head of Iranian Red Crescent said more than 70,000 people were in need of emergency shelter.

Iranian Interior Minister Abdolreza Rahmani Fazli said some roads were blocked and were worried about casualties in remote villages. The Iranian armed forces have been deployed to help the emergency services.

An Iranian oil official said pipelines and refineries in the area remained intact.

Iran sits astride major fault lines and is prone to frequent tremors. A magnitude 6.6 quake on December 26, devastated the historic city of Bam, 1,000 kilometers (600 miles) southeast of Tehran, killing about 31,000 people.