FOR more than a century, travellers, traders, tribesmen and the occasional terrorist have wandered freely across the Afghanistan-Pakistan border. That came to an abrupt end on June 1st. For the first time, Pakistan imposed full border controls at Torkham near the Khyber Pass, used by around 15,000 people daily. This is sure to cause hardship for the 40m Pushtuns living on both side of the border. It also shows how regional power dynamics are shifting.

Despite the government’s warning, people were surprised—many did not even have passports to hold their newly required visas. One traveller reported seeing pregnant women lying by the road, desperate to get to a hospital in Peshawar, on the Pakistan side. Commerce will also suffer. Peshawar’s private hospitals rely on fees from a steady stream of Afghan patients. Afghan carpets are really Afghan-Pakistani carpets: woven in Afghanistan, but usually cut, cleaned and sold in Pakistan.

For Afghanistan, the closure inflames the old wound over the Durand Line, which defines the border. The line was agreed in 1893 between the then-king of Afghanistan and the British Raj. It sliced through Pushtun communities. Afghanistan still refuses to recognise it, or give up claims to a big chunk of Pakistani territory.

Some Afghans believe the border closure is intended to punish them. The goodwill following Ashraf Ghani’s election as president of Afghanistan has ebbed. His term began with a charm offensive: he sent cadets for officer training in Pakistan, called on Pakistan’s army chief in Islamabad, and dropped a longstanding request for Indian military aid, including attack helicopters. But after a series of Taliban attacks he has returned to the anti-Pakistan rhetoric typical of Afghan politicians; he accuses Pakistan of sponsoring and sheltering Taliban leaders.

Pakistan, meanwhile, has taken umbrage at India’s rising influence in Afghanistan. Minimising the old enemy’s presence on its western flank has long been an obsession for Pakistani leaders. Narendra Modi, India’s prime minister, opened Afghanistan’s new parliament building in December. On June 4th he inaugurated a restored dam near the western city of Herat. India financed both structures. In May Messrs Modi and Ghani, along with Hassan Rohani, Iran’s president, struck a partnership to develop Iran’s Chabahar port (see article). The port project will compete with Pakistan’s China-backed port in Gwadar, just 170km east of Chabahar. A retired Pakistani defence secretary reflected establishment views when he told a conference that the Chabahar development represented a “security threat to Pakistan”. Pakistan’s building of fences and fortifications has triggered cross-border skirmishing in the past. And it has periodically shut the border when it wanted to express annoyance at Afghanistan. On May 10th the border was closed for four days after Afghan forces blocked Pakistan’s efforts to erect border fencing. But this time passport controls look set to become permanent. Officials promise to extend them to the six other border crossings in due course. Pakistan’s army insists that tighter controls are a security measure, unrelated to the region’s power politics. The army believes that three terrorist attacks in and near Peshawar, including the gruesome slaughter of more than 130 boys at the city’s Army Public School, involved terrorists who had freely crossed into the country at Torkham. Some in Pakistan have even started to question the “easement rights” granted to tribes divided by the border, maintaining that they were intended to let tribesmen travel short distances across the border, not have unfettered access to all of Pakistan. Demands that Afghan refugees, some of whom have lived in Pakistan since the Soviet invasion of the 1980s, return home have grown louder.

The potential damage to cross-border trade and diplomatic relations does not bother Pakistan’s defence establishment, says Rahimullah Yousafzai, a Peshawar-based watcher of frontier affairs. “Pakistan is going to be much less big-hearted than before,” he predicts.