TEHRAN // Images of homeless drug addicts living in empty graves just outside the Iranian capital have deeply shocked the public and prompted reaction even from president Hassan Rouhani.

The daily Shahrvand newspaper published the images on Tuesday in a report on the homeless people – about 50 men and women – who dwell in a cemetery in the town of Shahriar, 30 kilometres west of Tehran.

The story and haunting images of the men and women staring into the camera from inside the unused grave slots spread quickly on social media, where users and celebrities reacted with expressions of alarm and sadness.

Oscar-winning Iranian director Asghar Farhadi aired his frustration in a letter to Mr Rouhani.

“I read the report ... and now my entire being is filled with shame and sorrow,” he wrote.

“With this letter, I intend to share my shame with you and all those who have had any responsibility in this country” in the past few decades, he added.

The president responded to Farhadi’s “painful” letter on Wednesday.

“Who can see human beings hurt from social issues who take shelter in graves ... and not feel ashamed?” Mr Rouhani said in a speech about government supervision.

“I have heard about people in western countries who sleep on cardboard under bridges out of poverty, or those who sleep in metro stations, but not in graves,” he said.

“To solve these issues we must all unite and leave aside partisan issues and differences and address the basic problems of the country.”

In a follow-up report, Shahrvand said the grave-dwellers were forcibly removed from the cemetery, after promises from authorities to resolve the issue.

Some of those who lived in the graves had done so for 10 years, according to the paper.

“Aren’t we humans? Are we foreigners? We are Iranian too,” an unnamed homeless man told the Shahrvand in a video.

He asked authorities to build a shelter in the area.

The report is a rare glimpse into the lives of homeless people in the Iranian capital.

In October another report on homeless people occupying sewage canals on Tehran’s motorways triggered similar reactions.

Poverty has worsened in recent years in Iran.

The official unemployment rate has risen to 12.7 pervcent this year from 10.6 per cent in 2014, while joblessness among teenagers and young adults has reached 27 per cent.

* Agence France-Presse