On the face of it, the return of huge numbers of refugees has gone remarkably well, but in every province there are hundreds of land disputes and complaints of illegal occupation, and tens of thousands of returnees remain in tents, crammed in with relatives, or in public buildings. The pressure for housing and land remains enormous.

Image Refugees returning from exile are building houses in Kelagay, their ancestral village in Baghlan Province, in northern Afghanistan. Credit... Hiromi Yasui for The New York Times

This village is one such example. The whole population, 200 families, fled one night, with just the clothes on their backs, in 1980 after a raid by Soviet troops that killed 40 people. Now they number 360 families, they said. They arrived in a long convoy of trucks and cars, laden with animals, household belongings, even roof beams. Despite the war and the hardships of the refugee camps, they had prospered and multiplied in their 26 years away.

Haji Abdul Momin, 75, has two wives, 10 children and 10 grandchildren, and he has taken a plot big enough to house the whole family.

“I used to live in the village — we were very few then,” he said. “Now we have increased. We are 23 people, and I don’t have enough land.”

Every family interviewed said the same. Only one man, Sirajuddin, 45, a butcher who uses one name, had rebuilt his family home in the old village. He and his brothers had agreed he would live in the house and farm the fields, and his brothers had secured one of the new plots for their families, he said. His neighbor, Mr. Jabar, had started rebuilding his family house in the village but never moved in. “I would gain the enmity of my brothers, so I have left it empty,” he said.

While it is clear they all need more space, their haste in occupying the land was driven by other concerns, the villagers admitted. Other people from different parts of the province had begun to settle here, said one villager, Haji Paiwand, 50. So the whole village, who are all from one Pashtun tribe, decided to return home together to stake their claim to the land before others took it all, he said.

“The whole tribe decided to come back, and if one family had stayed behind it would not have looked good,” Mr. Momin said.