The Taliban, fighting a 15-year war against the western-backed government of Afghanistan, attacked a joint Afghan-Pakistani military base near the town of Tangi of Paktika province in eastern Afghanistan, and clashed with an Afghan army battalion in Paktika’s Baghlan province, killing 24 army personnel, including women and children.

Pakistan has long had an alliance with the Taliban, with one of the main insurgent groups that it supports — Harakat-ul-Jihad-Islami — having good relations with members of Pakistan’s intelligence services, who have provided them with information and arms that they use to attack NATO forces, as well as Afghan security forces. More recently, the Pakistani government has let the Taliban and other jihadi groups, such as Jamaat-ur-Ahrar, get away with killing civilians in the eastern part of the country, since al-Qaeda can certainly be beat up and integrated into the Pakistani state when the time is right.

The Taliban are walking a tightrope. Some factions have access to safe havens in Pakistan and even smuggle in arms from across the border into Afghanistan. But other groups have formed strategic alliances with the U.S.-backed government, which are hampered by the Islamic State’s infiltration in the south of the country.

On the other hand, President Donald Trump’s decision to get out of Afghanistan led many to conclude that it had encouraged Pakistan to take a more aggressive role against the Afghan Taliban.

Because of such competing interests, the U.S. does not seem sure what to do.