Through three decades of war, waves of Afghans have fled their homes along the eastern border areas, many of them seeking shelter in the Pakistani tribal regions next door. Last summer another wave of refugees surged through the area. But in a reversal, it is Pakistanis, not Afghans, who are fleeing war at home.

On June 2014, the Pakistani army  launched an offensive in the tribal region of North Waziristan, after years of international pressure to move against militants. The military has been clearing territory in the region since June, forcing an exodus of at least 1.5 million residents. As many as 250,000 of them have since crossed the border into Afghanistan

For many of the refugees, Afghanistan represents a relief not only from bombardment but from the draconian rule of the Pakistani Taliban and foreign Islamist fighters. In North Waziristan, the militant groups had largely forced out any civilian or tribal leadership, in a brutal reign that left much of the local population alienated and frightened.

Most families came on foot, and often fled in haste with few belongings. Many tell the same story: a public warning by the Pakistani Army giving them three days to leave their homes, desperate negotiations as elders tried to win permission for civilians to stay, and then the terror of the artillery and aerial bombardments of their villages.

The tribal communities on both sides of the border are Pashtun, and many of the refugees from the Pakistani side have found shelter with relatives or sympathetic families on the Afghan side, mostly in Khost and Paktika Provinces. In some cases, refugees have been able to rent or borrow a patch of land or a walled compound for their families and some livestock.

But the poorest — about 3,000 families, according to the United Nations refugee agency — are perched in Gulan Camp, a stretch of rough stones and reed bushes in the Gorbuz district of Khost, just a few miles from the border.