SARPOL-E-ZAHAB, Iran (AP) - Iranian President Hassan Rouhani launched an investigation Tuesday into why government housing built by his hard-line predecessor collapsed while others withstood a powerful earthquake near the border with Iraq that killed more than 530 people.

In the Kurdish town of Sarpol-e-Zahab, which was reconstructed in the decades since the 1980s war with Iraq, the outer walls of apartment complexes tumbled away in the magnitude 7.3 earthquake Sunday night. The housing was built as a part of the "Mehr" or "kindness" project of former President Mahmoud Ahmadinejad.

Some now-homeless survivors simply wept outside, while others angrily showed Associated Press journalists the destruction done by the quake.

A woman mourns at an earthquake site in Sarpol-e-Zahab in western Iran, Tuesday, Nov. 14, 2017. Rescuers are digging through the debris of buildings felled by the Sunday earthquake in the border region of Iran and Iraq. (AP Photo/Vahid Salemi)

"Other buildings near our apartment are not damaged as much because they were built privately," said Ferdows Shahbazi, 42, who lived in one of the Mehr buildings.

She sarcastically added: "This is 'kindness' as the name suggests very well!"

Rescuers used backhoes and other heavy equipment to dig through toppled buildings in Sarpol-e-Zahab, home to more than half of the dead. The apartment complexes sit next to lush pastures in the almost entirely Kurdish province of Kermanshah, nestled in the Zagros Mountains along the border with Iraq.

Both rescuers and residents stood on the remains of homes, looking through the rubble. Searchers used dogs to comb the debris - just as they have since Iran's 2003 earthquake in Bam that killed 26,000 people - although some clerics insist the animals are unclean.

The quake badly damaged the Sarpol-e-Zahab hospital, forcing the army to set up field clinics. The quake also reportedly killed an unspecified number of soldiers in an army garrison.

Aside from the 530 people killed in Iran, 7,817 were injured, the state-run IRNA news agency reported. Health Minister Hassan Ghazizadeh Hashemi, who visited Kermanshah on Tuesday, warned that the death toll probably would rise.

"My feeling is that number ... will increase since victims were buried in many villages that their exact statistics will be announced in coming days," he said, according to the semi-official ISNA news agency.

Rouhani inspected the damage in the province and offered his support.

"This was a pain for all Iranians," he said. "Representing the nation of Iran, I offer my condolences to the people of Kermanshah, and tell them that all of us are behind Kermanshah."

Foreign Minister Mohammad Javad Zarif thanked foreign countries offering to help but wrote on Twitter: "For now, we are able to manage with our own resources."

Also touring the area was cleric Abdolhossein Moezi, a representative of Supreme Leader Ayatollah Ali Khamenei. Moezi said there was a need for more relief material and "security."

That was echoed by Nazar Barani, the mayor of the town of Ezgeleh, who told state TV his constituency still had a "deep need" for food, medicine and tents. He said 80 percent of the buildings in the town had been damaged.

The temblor hit about 19 miles (31 kilometers) outside the eastern Iraqi city of Halabja, according to the U.S. Geological Survey, and struck 14.4 miles (23.2 kilometers) below the surface, a somewhat shallow depth that can cause broader damage.

Nine people were killed in Iraq and 550 were injured, all in the country's northern, semiautonomous Kurdish region, according to the United Nations.

The disparity in casualty tolls has drawn questions from Iranians, especially because so much of Sarpol-e-Zahab was new. Initial Iranian government estimates suggest the quake destroyed 12,000 apartments and free-standing homes, and damaged another 15,000.

Some immediately pointed to the Mehr homes. About 2 million units were built in Iran, including scores in Sarpol-e Zahab, as part of a populist program by Ahmadinejad, who also offered cash payouts and other incentives to appease the public while Iran faced crippling economic sanctions over its nuclear program.

But after the housing was built, some didn't have paved roads or water going to them. Many warned that the low-quality construction could be a problem in Iran, which faces near-daily earthquakes and sits on many major fault lines.

Ahmadinejad's official channel on the messaging app Telegram, which is popular in Iran, called the accusations "media slander" and said those who circulated photos and videos of damaged Mehr homes were "clumsy charlatans."

Ahmadinejad adviser Ali Akbar Javanfekr also wrote on a website for allies of the former president: "Heavy waves of propaganda against Mehr are aimed at covering up the weakness and inefficiency of the (Rouhani) administration in helping quake-hit people."

In May, a magnitude 5.7 quake in the northeastern city of Bojnourd heavily damaged similar Mehr projects there. Many still sit uncompleted across the country because the program ran out of cash.

Rouhani said in Sarpol-e-Zahab that the government would look into what went wrong at the Mehr homes, some of which his administration handed over.

"The faults and shortcomings in the construction of these buildings should be investigated," he said. "And the government will surely follow up on these issues and identify the culprits and introduce them to the people."

Rouhani added: "We saw what happened to the Mehr buildings though even a single window was not broken in people's privately built homes."

He promised cash payments and loans to those affected so they can build new homes with contractors of their choice. He also urged local officials to be generous with disaster relief.

Damage wasn't limited to housing. In the nearby Kurdish town of Eslamabad, a hospital only recently inaugurated by the government collapsed, killing several people there, lawmaker Heshmatollah Falahatpisheh said.

"Several became victims of treason," the lawmaker said, according to a report by the semi-official ILNA news agency. "The death toll could have been much less if the hospital was not destroyed. The city's old hospital, some 30 years old, did not suffer serious damage."

___

Karimi reported from Tehran. Associated Press writer Jon Gambrell in Dubai, United Arab Emirates, contributed.

An earthquake survivor carries his belongings in front of damaged buildings, in a compound which was built under the Mehr state-owned program, in Sarpol-e-Zahab in western Iran, Tuesday, Nov. 14, 2017. Iran's President Hassan Rouhani says his administration will probe the cause of so much damage to buildings constructed under the Mehr program after a powerful earthquake hit the area along the border with Iraq on Sunday which killed hundreds of people. (AP Photo/Vahid Salemi)

Survivors sit in front of a destroyed house on the earthquake site in Sarpol-e-Zahab in western Iran, Tuesday, Nov. 14, 2017. Rescuers are digging through the debris of buildings felled by the Sunday earthquake in the border region of Iran and Iraq. (AP Photo/Vahid Salemi)

Rescuers work on the debris on the earthquake site in Sarpol-e-Zahab in western Iran, Tuesday, Nov. 14, 2017. Rescuers are digging through the debris of buildings felled by the Sunday earthquake in the border region of Iran and Iraq. (AP Photo/Vahid Salemi)

Rescuers carry away the body of an earthquake victim in Sarpol-e-Zahab in western Iran, Tuesday, Nov. 14, 2017. Rescuers are digging through the debris of buildings felled by the Sunday earthquake that killed more than four hundreds of people in the border region of Iran and Iraq. (AP Photo/Vahid Salemi)

A rescue worker searches the debris with his sniffing dog on the earthquake site in Sarpol-e-Zahab in western Iran, Tuesday, Nov. 14, 2017. Rescuers are digging through the debris of buildings felled by the Sunday earthquake that killed more than four hundreds of people in the border region of Iran and Iraq. (AP Photo/Vahid Salemi)

Survivors sit on the debris while rescuers search on the earthquake site in Sarpol-e-Zahab in western Iran, Tuesday, Nov. 14, 2017. Rescuers on Tuesday used backhoes and heavy equipment to dig through the debris of buildings toppled by a powerful earthquake on the border between Iran and Iraq. (AP Photo/Vahid Salemi)

A woman sits on the debris on the earthquake site in Sarpol-e-Zahab in western Iran, Tuesday, Nov. 14, 2017. Rescuers are digging through the debris of buildings felled by the Sunday earthquake in the border region of Iran and Iraq. (AP Photo/Vahid Salemi)

People and rescuers move a destroyed car on the earthquake site in Sarpol-e-Zahab in western Iran, Tuesday, Nov. 14, 2017. Rescuers are digging through the debris of buildings felled by the Sunday earthquake in the border region of Iran and Iraq. (AP Photo/Vahid Salemi)

A rescue worker walks past the rubble of a collapsed building at an earthquake site in Sarpol-e-Zahab in western Iran, Tuesday, Nov. 14, 2017. Rescuers are digging through the debris of buildings fallen by Sunday's earthquake in the border region of Iran and Iraq. (AP Photo/Vahid Salemi)

An earthquake survivor sits on debris in front of his house in a compound, which was built under the Mehr state-owned program, in Sarpol-e-Zahab in western Iran, Tuesday, Nov. 14, 2017. Iran's President Hassan Rouhani says his administration will probe the cause of so much damage to buildings constructed under the state-owned program after a powerful earthquake hit the area along the border with Iraq on Sunday which killed over 400 people. (AP Photo/Vahid Salemi)

An earthquake survivor carries her belongings over debris in front of her house, in a compound which was built under the Mehr state-owned program, in Sarpol-e-Zahab in western Iran, Tuesday, Nov. 14, 2017. Iran's President Hassan Rouhani says his administration will probe the cause of so much damage to buildings constructed under the state-owned program after a powerful earthquake hit the area along the border with Iraq on Sunday which killed over 400 people. (AP Photo/Vahid Salemi)

Earthquake survivors carry their belongings in front of damaged buildings, in a compound which was built under the Mehr state-owned program, in Sarpol-e-Zahab in western Iran, Tuesday, Nov. 14, 2017. Iran's President Hassan Rouhani said his administration will probe the cause of so much damage to buildings constructed under the state-owned program after a powerful earthquake hit the area along the border with Iraq on Sunday which killed over 400 people. (AP Photo/Vahid Salemi)

An earthquake survivor collects belongings from her damaged apartment at a compound which was built under the Mehr state-owned program, in Sarpol-e-Zahab in western Iran, Tuesday, Nov. 14, 2017. Iran's President Hassan Rouhani says his administration will probe the cause of so much damage to buildings constructed under the state-owned program after a powerful earthquake hit the area along the border with Iraq on Sunday which killed over 400 people. (AP Photo/Vahid Salemi)

An earthquake survivor weeps as she sits in front of damaged buildings, in a compound which was built under the Mehr state-owned program, in Sarpol-e-Zahab in western Iran, Tuesday, Nov. 14, 2017. Iran's President Hassan Rouhani says his administration will probe the cause of so much damage to buildings constructed under the Mehr program after a powerful earthquake hit the area along the border with Iraq on Sunday which killed over 400 people. (AP Photo/Vahid Salemi)

An earthquake survivor weeps in front of her house in a compound which was built under the Mehr state-owned program, in Sarpol-e-Zahab in western Iran, Tuesday, Nov. 14, 2017. Iran's President Hassan Rouhani says his administration will probe the cause of so much damage to buildings constructed under the Mehr program after a powerful earthquake hit the area along the border with Iraq on Sunday which killed hundreds of people. (AP Photo/Vahid Salemi)

Buildings are damaged by an earthquake in a compound which was built under the Mehr state-owned program, in Sarpol-e-Zahab in western Iran, Tuesday, Nov. 14, 2017. Iran's President Hassan Rouhani says his administration will probe the cause of so much damage to buildings constructed under the Mehr program after a powerful earthquake hit the area along the border with Iraq on Sunday which killed over 400 people. (AP Photo/Vahid Salemi)

Earthquake survivors remove debris to salvage their belongings in Sarpol-e-Zahab in western Iran, Tuesday, Nov. 14, 2017. A powerful earthquake hit the area along the border with Iraq on Sunday and killed over 400 people.(AP Photo/Vahid Salemi)

Earthquake survivors carry their belongings in front of damaged buildings, in a compound which was built under the Mehr state-owned program, in Sarpol-e-Zahab in western Iran, Tuesday, Nov. 14, 2017. Iran's President Hassan Rouhani says his administration will probe the cause of so much damage to buildings constructed under the Mehr program after a powerful earthquake hit the area along the border with Iraq on Sunday which killed over 400 people. (AP Photo/Vahid Salemi)