By Josh Smith

TORKHAM, Afghanistan (Reuters) - Perched on top of lumbering trucks overflowing with all their possessions, Afghan families are streaming back to their home country at unprecedented rates, leaving international organizations scrambling to provide aid as winter approaches.

The flow of returnees from neighboring Iran and Pakistan this year, estimated by the United Nations to number more than half a million, is straining the capacity of the government and aid agencies, even as violence uproots more Afghans around the country.

At Torkham, the busiest border crossing between Afghanistan and Pakistan, nearly 170,000 Afghans have returned this year, according to the U.N., many of them citing harassment by Pakistani authorities as relations between the two countries have deteriorated.

Islamabad has stepped up pressure to send people back and numbers have risen sharply in recent months as Afghan-Indian relations strengthened and those between India and Pakistan soured.

Lines of colorfully decorated trucks pass through the border gate at Torkham, navigating the mountainous passes with returning refugees clinging to piles of household goods, sometimes with a family cow nearly buried in the back.

A cluster of white tents only a few hundred meters from the border marks the first facility operated by the U.N., the Afghan government, and other aid agencies to provide aid for returnees before they look for a home in a country many have not seen in years.

Here, and at other sites nearby, families are offered medical checkups, bundles of basic supplies and food.

In September, the U.N. issued an appeal for millions of dollars of emergency funding to help returning refugees and other internally displaced people in Afghanistan, but so far the fundraising has yet to reach its goal, said Mark Bowden, the U.N.'s humanitarian coordinator in Afghanistan.

"Out of the $150 million that we requested, we've only got $48 million so far, and our costs are certainly going to be running quite high over the winter period," he told Reuters.

FREEZING TEMPERATURES

While the winter is usually mild in the area of Nangarhar province where many returning refugees have at least temporarily settled, many others have headed further west to Kabul, where freezing temperatures may take a toll on anyone unable to find accommodation, Bowden said.

Escalating friction between Afghanistan and Pakistan flared into brief clashes at the Torkham border crossing in June, the violence symptomatic of a wider decline in relations between Pakistan and Afghanistan that has prompted political and sometimes military confrontations.

Both countries accuse the other of harboring hostile militant groups, and Pakistan has been wary of Afghanistan's deepening ties with India.

But Pakistani officials deny there has been systematic harassment of Afghans living in Pakistan and say their country has demonstrated great generosity to the refugee population, despite severe economic problems of its own.

While the challenges of helping the returning Afghan refugees requires immediate attention, the international community should work with Afghanistan, Pakistan, and Iran to try to solve the broader problems driving the crisis, said Tadamichi Yamamoto, head of the U.N. assistance mission in Afghanistan.

"This could be a long-term issue, but I think the immediate attention now will define the magnitude of the problem that we have down the road," he said. "So we need to do it right at the start."

(Reporting by Josh Smith; Editing by Ros Russell)