KARACHI -- Muhammad Shakirullah's family felt they had no choice but to flee to Pakistan from their home country of Afghanistan in October 1979.
A native of Kabul Province, Shakirullah said that he was 15 years old when his parents moved to Karachi to escape oppression by the Soviet-backed Afghan communist government.
"Although the conflict intensified in December of that year [the Soviet invasion], people started leaving the country in October to save their lives," he said.
He and his family are still sheltered in Pakistan 40 years later.
"We are grateful to Pakistan for hosting us for four decades with dignity," Shakirullah said at Camp Jadeed, a refugee camp on the outskirts of Karachi.
Afghan refugees and the United Nations High Commissioner for Refugees (UNHCR) are praising the role of Pakistan in ensuring a welcome to and treatment of Afghans in the country over the past 40 years.
Pakistan has provided shelter to one of the world's largest long-term refugee populations with more than 5 million Afghans residing for some period in Pakistan since 1979, according to the UNHCR.
While many had fled the Soviet invasion, others sought to escape the violent insurgency of the Taliban and more recently that of the "Islamic State of Iraq and Syria" (ISIS).
A large number of refugee children and youth now are part of a second or third generation born and raised in Pakistan, said Haji Abdullah Bukhari, a representative of Afghan refugees in Sindh Province.
"Most of them have never visited Afghanistan, lack linkages with their ancestral country of origin and will therefore require strong incentives to return along with adequate opportunities for a sustainable reintegration," said Bukhari.
Qaiser Khan Afridi, a UNHCR spokesman in Islamabad, lauded the Pakistani government and Pakistanis for generously hosting millions of Afghan refugees for such a lengthy time.
Pakistan continues to host 1.4 million Afghan refugees, while about 4.4 million have returned to Afghanistan since 2002 under the UNHCR-supported voluntary repatriation programme, he said.
Government’s efforts to help refugees
Prime Minister Imran Khan on September 16, 2018, declared Pakistan's intention to grant citizenship to 1.5 million Afghan refugees who have lived on the margins of Pakistan's society for decades. He did so in the face of heavy criticism from Pakistan's ethno-political groups.
Khan confirmed his intentions two days later while addressing the National Assembly. Under the Right to Pakistan Citizenship Act of 1951, those born to refugees in Pakistan are entitled to citizenship, he said.
"We cannot force their repatriation, according to UN conventions," he said.
Because of the backlash, Pakistan ultimately did not grant citizenship to the children of Afghan refugees.
Still, the federal government has taken a number of initiatives to help resolve problems faced by Afghan refugees.
Khan on February 25 ordered banks in Pakistan to allow all registered Afghan refugees to open accounts.
That was a relief for Shoukat Safeer, a 41-year-old trader. He has been running his carpet shop in the Sohrab Goth area of Karachi for the past 12 years. However, being of Afghan descent, he could not open a bank account, which caused serious problems for his business.
Meanwhile, other steps to help Afghan refugees are under consideration.
The government is considering allowing Afghan refugees to purchase property and vehicles and apply for driving licences, said an official in the Ministry of States and Frontier Regions.
"The government fully understands the issues faced by refugees and has been trying its best to resolve them," said the official, who requested anonymity because he was not authorised to speak to the media.
Iran's hostile policy towards refugees
How refugees are treated in Iran is a completely different story, say Afghans.
Bashir Khilji, a refugee from Helmand who now lives in Quetta, spent a year in Iran. Iranian law enforcement officials treat refugees inhumanely and forcibly deport them, he said.
"If you compare it with Iran, Pakistan is heaven for us. We can openly travel and do business in Pakistan," Khilji said. "But in Iran, refugees' rights are completely denied. They are treated as second-class citizens there."
Iranian law enforcement agencies did not allow refugees to travel in the country, confined them to refugee camps and physically abused them, he added.
Last year, a video showing Iranian border guards violently abusing and humiliating Afghan refugees went viral on social media, evoking sharp criticism and public outrage among Afghans and international human-rights organisations.
In addition, Iran is taking advantage of Afghan refugees' desperation by sending children of Afghan refugees to fight in the Syrian war in return for money and the promise of an Iranian residency permit, according to a Human Rights Watch report.