The number of Afghan refugees in Pakistan returning to their homeland is expected to decrease this year, United Nations (UN) officials said Thursday, after a record number of repatriations in 2016 sparked fears of a humanitarian crisis.

Some 32,000 registered refugees have returned from Pakistan since April 3, when repatriations for the year began following the winter, the body said. A record 370,000 Afghans left Pakistan last year, many of whom were second or even third generation migrants of people fleeing the Soviet invasion of Afghanistan during the 1980s, surging from 55,000 the year before.

Observers said the exodus was compounded by a hardening of Pakistani attitude towards Afghans. But what appears to be an improving environment in Pakistan, coupled with perceptions the Afghan government has failed to uphold pledges of assistance towards returnees, has now slowed the rate of return.

“The environment in Pakistan is very different today from this time last year. There were more palpable push factors in Pakistan for Afghans to return home last summer,” said Dan McNorton, a spokesman for the UN refugee agency.

In February this year, Islamabad announced a new policy for the management of Afghan refugees which included the registration of undocumented Afghans, adopting a refugee law and a new visa regime for Afghans.

Such measures in turn have encouraged Afghans to continue living in Pakistan rather than risk leaving for Afghanistan where fighting rages between the government, the Taliban and the militant Islamic State (ISIS) group.

Security in Kabul, where many returnees seek refuge, has deteriorated in the last week, as anger grows after a massive bomb in the city's diplomatic quarter killed more than 150 people.

Assistant packages from the UNHCR have also been scaled back to $200 per person, officials said. Last year they had been upped to $400, which observers said also acted as an incentive for the flood of returnees.

Some 4.2 million Afghan refugees have returned to Afghanistan voluntarily under the UNHCR-funded Voluntary Repatriation programme since 2002. But UNHCR and Pakistani officials have said some 1.34mn registered refugees still live in Pakistan.

Estimates say there are a further half million undocumented refugees in the country.

Indrika Ratwatte, the UNHCR country representative for Pakistan, said some degree of fatigue had set in after 37 continuous years of hosting one of the largest refugee populations in the world. But rights group HRW had been scathing of Pakistan's “coercive” approach towards repatriation in the past, accusing the government of arbitrary detentions and other violations.