For millions of Afghan refugees in Iran and Pakistan, as their legal rights to reside in these countries expire by the end of this year, they may be unwilling to return to their homeland battered by more than a decade of war.

In a global context, there are more displaced Afghans than any other nationality – and they are largely unwanted in their new environments. In fact, the United Nations estimates that almost one-fifth of all Afghans on the planet are displaced.

Over the past decade, about 5.5-million Afghans have returned home, but millions more live in refugee camps in Iran, Pakistan and elsewhere.

Afghans have been fleeing their homeland in massive numbers since 1979 when Russian tanks invaded their mountainous nation. Over the next three decades, other cataclysmic developments, including war and the brutal reign of the Taliban, kept the exodus going in full gear.

In Pakistan alone, there are now at least 2.7-million Afghan refugees, only 1.7-million of whom are “registered” (meaning they have the legal right to temporary residence in the country).

Life for Afghans in Pakistan’s overcrowded and unsanitary camps is one of misery and fear.

Mohammed Nazar, an Afghan doctor who has lived in Pakistan for almost two decades, told Voice of America: “There are no facilities for the children, there is no hygiene, no electricity, there are scorpions and snakes. We only have medicine for headaches. For anything else they go to the hospital.

One elderly Afghan refugee named Sana Gul complained VOA: Every day [Pakistani] police come and ask us for money. Most of us don't have immigrant IDs, and if we refuse to pay them, they take us to the police stations and threaten to deport us, then we have pay them more.

However, as inhospitable as Pakistan may be, the security situation in Afghanistan is even worse. Moreover, many Afghan refugees have been in Pakistan so long, they know of no other place as home.

 We have no other choice. We have to live here, said Ghuluan Sarwar, an Afghan resident in Pakistan for 30 years. We know we face a lot of problems here, but in Afghanistan there are more problems, like the Taliban, terrorism.

However, Shaukat Ullah, Pakistan’s Minister of States and Frontier Regions, whose government may extend the legal residency rights for some Afghan refugees, warned nonetheless that most of the refugees must return home soon.

It's a big burden on our economy, we are facing that problem, he said.

The United Nations High Commissioner for Refugees (UNHCR) said it plans to help repatriate 150,000 Afghan refugees from Pakistan this year on a strictly voluntary basis.

An editorial in Dawn, an English-language Pakistan’s daily, described the absurdity of people seeking refuge in a country like Pakistan.

“With a collapsed economy, broken infrastructure, rampant violence and terrorism, Pakistan hardly qualifies to be a sanctuary,” wrote Murtaza Haider.

He pointed out that there are millions more of internally displaced Pakistanis who have fled floods and local conflicts, placing immense pressures on the country’s already overcrowded cities.

“Cities like Karachi and Peshawar were transformed by the migrants to such an extent that the refugees replaced the prevailing customs, cuisines, and even languages,” he added.

“At the same time, the humongous influx of humanity has overburdened the urban infrastructure resulting in urban rot.”

Another million Afghan refugees are located in Iran – where they are also unwanted.

Iranian officials have long used its Afghan population as a bargaining chip in its dealings with Kabul, particularly when Afghanistan seeks to ratify deals or cooperate in any way with the U.S.