A powerful magnitude-7.3 earthquake struck the Iraq-Iran border region Sunday, killing more than 330 people in both countries, authorities reported.

The U.S. Geological Survey said the epicenter was 19 miles outside the Iraqi city of Halabja. The semi-official Iranian ILNA news agency reported at least 14 provinces were impacted by the quake. Several thousand were reported injured. 

Residents huddle by a fire in an open area following an earthquake at Sarpol-e Zahab in Iran's Kermanshah province on Nov. 13, 2017.

Iran’s state-run news agency reported the quake killed 328 people in the country and state television said 3,950 were injured. The western Kermanshah province was worst-hit.

Iraq’s Interior Ministry said the earthquake killed at least seven people and injured 535 in the semiautonomous Kurdish region.

Previously: Quake rescue dog named Frida becomes national hero in Mexico

Iranian social media was abuzz with posts of people evacuating their homes, especially from the cities of Ghasr-e Shirin and Kermanshah. The earthquake struck in a rural, mountainous region where residents rely mainly on farming to make a living.

Esmail Najar, head of Iran’s National Disaster Management Organization, said “some injured people might be buried under the rubble in Ghasr-e Shirin.”

Ayatollah Ali Khamenei, Iran’s Supreme Leader, offered his condolences Monday and urged all government agencies to do all they could to help those affected. 

Iran is prone to near daily quakes as it sits on many major fault lines. In 2003, a magnitude-6.6 earthquake flattened the historic city of Bam, killing 26,000 people.

Sunday's earthquake hit in the "Zagros fold and thrust belt" where the Arabian and Eurasian plates collide — producing several earthquakes, said Jascha Polet, a seismologist at California State Polytechnic University-Pomona.

"There have been many earthquakes between magnitude 5 and 6, but only a few over magnitude-7," Polet told USA TODAY. "An earthquake this size can produce significant damage, especially as this region, where the population resides in structures that are highly vulnerable to earthquake shaking."

In 1978, a magnitude-7.4 earthquake hit Tabas, Iran, and killed about 20,000 people. It was the third deadliest natural disaster on record.

A Rudaw TV news anchor interviewed a guest in the Kurdish city of Sulaimani in northeastern Iraq when the studio was hit by the quake. Eventually, the rumble made its way to Irbil, where the anchor left his chair for safety.

Rudaw reported 50 people hurt in Darbandikhan, about 20 miles southeast of Sulaimani. Officials in Halabja declared an emergency and told workers to stay home on Monday for cleanup efforts.

Halabja, 10 miles from the Iranian border, is home to the chemical weapons attack by Saddam Hussein in 1988 that killed as many as 5,000 residents in what was called “Bloody Friday.”

A separate magnitude 6.5 earthquake hit Costa Rica on Sunday. The U.S. Geological Survey says the earthquake was centered along the country's Pacific coast about 10 miles southeast of Jaco, which is about 60 miles southwest of San Jose.

Contributing: The Associated Press