Baghdad/Ankara (Reuters): A magnitude 7.3 earthquake hit the region around the border between Iran and Iraq on Sunday, killing at least 145 people state media in the two countries said, as rescuers searched for dozens trapped under rubble.

At least 141 people were killed in Iran , Behnam Saeedi, a spokesman for Iran’s National Disaster Management Organization, said on the state television. More than 850 were injured, he said.

The earthquake was felt in several provinces of Iran but the hardest hit province was Kermanshah, which announced three days of mourning.

More than 97 of the victims were in the town of Sarpol-e Zahab in Kermanshah, about 15 km (10 miles) from the Iraq border. The main hospital of the town was severely damaged and struggling to treat hundreds of injured people, state television reported.

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

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

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 night has made it difficult for helicopters to fly to the affected areas and some roads are also cut off... we are worried about remote villages,” Iranian Interior Minister Abdolreza Rahmani Fazli said in an interview on state television.

Many houses in rural parts of the province are made of mud bricks and are known to crumble easily in quake-prone Iran .

The Iranian armed forces have been deployed to help emergency services.

A quake registering a magnitude between 7 and 7.9 can inflict widespread and heavy damage.

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

On the Iraqi side, the most extensive damage was in the town of Darbandikhan, 75 km (47 miles) 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,” Rasheed told Reuters.

The district’s main hospital was severely damaged and had no power, 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.

Many residents in the Iraqi capital, Baghdad, rushed from their houses and tall buildings in panic.

“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 epicenter.

Iraq’s meteorology center advised people to stay away from buildings and not to use elevators, in case of aftershocks.