During the last stretch of his family’s journey home, Esmatullah perched atop a truckload of kitchenware, firewood and furniture, hurtling toward Kabul while the evidence of three decades in exile shifted beneath him.

On either side of the truck, the bazaars grew denser. The buildings became taller and more fortified. American convoys snaked through traffic, heading downtown.

Nearly two days after leaving their home in Pakistan, Esmatullah and his 22 relatives had made it to Afghanistan’s capital, after 30 years as refugees. They looked out at their country. They tried not to panic.

The uncertainty shrouding Afghanistan’s future has prompted thousands of Afghans to seek an escape route — foreign visa applications, asylum pleas, long journeys across the border. But every day, families swim against that current, returning to Afghanistan after years abroad, finding a country that has been transformed by all the development and war wrought by a decade-long U.S. intervention and a persistent insurgency.

Some of the returnees are here by choice — nostalgic for the country of their youth, drawn back by word of renewed security and opportunity. Most, like Esmatullah’s family, have returned involuntarily — compelled by the Pakistani government’s unwillingness to extend their refugee status.

Nearly 3 million Afghans will be expelled from Pakistan by the end of the year if an extension isn’t granted, according to the Office of the United Nations High Commissioner for Refugees. Such a mass deportation could further destabilize Afghanistan, straining its economy and challenging its fledgling security forces. Although UNHCR officials are optimistic that the issue will be resolved, many Afghans in Pakistan have responded to the looming deadline by heading home after years in exile.

Esmatullah’s father, Haji Bismillah, fled Afghanistan in 1979, at the beginning of the Soviet occupation. He was 35 when he left the country on horseback, with a wife and three young children. When he returned this month, he looked brittle, worn by hard decades. With him were his nearly two-dozen sons, daughters and grandchildren, most of whom had never been to Afghanistan.

As the family’s truck sped closer to downtown Kabul, Bismillah marveled at how the city had grown — shops and military bases and government buildings fanning out for miles. “I’m finally home,” he said.

But as Bismillah rejoiced, his sons, who spoke Pashto with thick Pakistani accents, grew worried. They had heard stories about terrorism and a bleak economy.

“I cannot stay here” thought Mohammed Ullah, 19. “I will run away.”

“There is no value for human life here,” thought his brother, Rahmatullah, 33.

What were they expecting? It is hard to say exactly. They didn’t know which stories were true, how bad the violence would be, whether their neighbors would assume that they were spies.

More than 8 million Afghans fled to Pakistan between 1979 and 2002. At least half of them have returned since 2001, attracted by the promise of a post-Taliban Afghanistan. When that transition proved rocky, many fled once again, the allure of home dimmed by protracted conflict.

Bismillah and his family watched those waves of migration just as they watched the war itself: from 500 miles away, on television, through stories from relatives and friends — a distance that imbued the unrest with a kind of unreality.

Then the war came to them. Last year, on a warm night in May, the brothers awoke to a large blast and the buzz of helicopters hovering above their adopted home town of Abbottabad, Pakistan. When the family awoke, they learned that al-Qaeda leader Osama bin Laden had been killed a mile from where they slept. The next day, they walked over to take photos of bin Laden’s littered compound.

The war knocked again when mounting tensions between Afghanistan and Pakistan — exacerbated by the bin Laden raid — meant that their visas would not be renewed, that they would have no choice but to return.

Rahmatullah had been sent to Kabul several weeks before the rest of the family to look for a home big enough for 23 people but cheap enough for the poor refugee family. He arrived on the same day that the Taliban executed a coordinated attack in seven locations across the country.

He called his father while the assault continued and pleaded, “Let’s not move. Let’s never move here.”

But Bismillah said they must. The Pakistani government had made life hard for Afghan refugees, he said. He was getting old. He wanted to die on his own soil.

So the family hired a driver with an open-roof truck and piled in their belongings: electric fans, carpets, bicycles, anything that would fit. Then the brothers each stuffed their bags and pockets with more sentimental items. Mohammed Ullah took photos of his classmates. Rahmatullah took a poster of his favorite park in Islamabad. Esmatullah took a shirt that said “Karachi.”

They drove through the night in early June, arriving as the sun rose at a UNHCR center on the outskirts of Kabul, where dozens of other families had lined up to be processed. An employee went from truck to truck asking families why they had decided to return. Most had come from refugee camps outside Peshawar, the largest city in Pakistan’s northwest. They accepted about $150 per person from the U.N. agency and disappeared to the surrounding districts or provinces, often to land doled out by the government.

When his turn came, Bismillah told the U.N. employee, “We’re here because we’re tired of being harassed in Pakistan. We are ready to come home.” He handed over a nearly expired refugee identification card.

Three days later, the 23 relatives had squeezed into a two-bedroom apartment with no electricity or running water. Most of the brothers slept on the floor.

Even Bismillah, first wowed by the city’s growth, was becoming frustrated. He got lost on his way to an old mosque, confused by a flurry of new activity on a familiar street. Still, the city seemed secure, he said: “We can walk around here. It is safe.”

His sons were not convinced. A week before they arrived, an American airstrike killed a family of five in their ancestral province of Paktia. A week after, more than 20 civilians were killed in a mix of Taliban attacks and NATO airstrikes in a single day. On local television stations, experts railed against what they called an insidious Pakistani influence.

Rahmatullah worried that his neighbors would accuse him of being a Pakistani spy and threaten the family. Someone pointed to his thick mustache — a fashion common in Pakistan but unusual in beard-loving Afghanistan — and asked him whether he was a foreigner. He considered shaving the mustache off.

“We stand out here,” he said. “It’s like we don’t belong.”

Mohammed Ullah dropped out of school to work at a construction site with a few of his brothers. He keeps his Abbottabad friends’ class portraits in his pocket while he mixes cement. He tells people that he’s Afghan, but he feels Pakistani.

Still, Bismillah was hopeful. His sons will come around, he said, and security in Afghanistan will improve.

Mohammed Ullah doesn’t pretend to believe his father.

“When I leave,” he said, “I will never come back.”