TORKHAM, Afghanistan — First, the Afghan families’ homes were raided by Pakistani policemen wielding sticks. Then the men were hauled off to jail, released only after relatives paid bribes.

When they had nothing left to pay, they said, they were told to leave Pakistan forever and return to Afghanistan — officially their native country, but a land foreign to many Afghan refugees after generations of flight across the border.

Such experiences have become increasingly common for Afghans living in Pakistan after the terrorist attack on a school in Peshawar in December. Though the attack was claimed by the Pakistani Taliban, the Afghan refugees say it fueled a new wave of resentment against them. Since then, almost a thousand Afghans a day have been streaming through the border crossing at Torkham, many saying they were forced out, others worried enough to pick up and leave.

It is not clear if the pressure on Afghans to leave Pakistan is the result of a widespread policy, or if local officials are taking advantage of the situation to expel unwanted refugees, as many Afghans suspect. But the numbers have clearly been growing. Afghan officials who screen traffic at Torkham report that more than 33,000 undocumented Afghans returned from Pakistan in the first six weeks of 2015 — more than for all of 2014.