Iran said rescue operations have ended in areas hit by a powerful weekend earthquake that killed at least 450 people and injured thousands of others, state television reported.
The 7.3 magnitude earthquake struck villages and towns in the mountainous area of Kermanshah province that borders Iraq yesterday while many people were at home asleep.
At least 14 provinces in Iran were affected.
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.
The earthquake was felt in several provinces of Iran but the hardest hit province was Kermanshah, which announced three days of mourning.
More than 236 of the victims were in Sarpol-e Zahab county in Kermanshah, about 15km from the Iraq border.
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 said.
The US 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.
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 prone to tremors
Iran sits astride major fault lines and is prone to frequent tremors. A magnitude 6.6 quake on 26 December 2003 devastated the historic city of Bam, 1,000km southeast of Tehran, killing about 31,000 people.
On the Iraqi side, the most extensive damage was in the town of Darbandikhan, 75km east of the city of Sulaimaniyah in the semi-autonomous Kurdistan Region.
More than 30 people were injured in the town, according to Kurdish Health Minister Rekawt Hama Rasheed.
"The situation there is very critical," he added.
The district's main hospital was severely damaged and had no power, Mr Rasheed said, so the injured were taken to Sulaimaniyah for treatment. Homes and buildings had extensive structural damage, he said.
In Halabja, local officials said a 12-year-old boy died of an electric shock from a falling electric cable.
Iraq's meteorology centre advised people to stay away from buildings and not to use elevators, in case of aftershocks.
Turkey and Israel
Residents of Turkey's southeastern city of Diyarbakir also reported feeling a strong tremor, but there were no immediate reports of damage or casualties in the city.
Turkish Red Crescent Chairman Kerem Kinik told broadcaster NTV that Red Crescent teams in Erbil were preparing to go to the site of the earthquake, and that Turkey's national disaster management agency, AFAD, and National Medical Rescue Teams were also preparing to head into Iraq.
AFADs chairman said the organisation was waiting for a reply to its offer for help.
In a tweet, Kinik said the Turkish Red Crescent was gathering 3,000 tents and heaters, 10,000 beds and blankets and moving them towards the Iraqi border.
"We are coordinating with Iranian and Iraqi Red Crescent groups. We are also getting prepared to make deliveries from our northern Iraq Erbil depot," he said.
Israeli media said the quake was felt in many parts of Israel as well.