Pakistan airstrikes in Afghanistan killed more than 40 people. Taliban warned Pakistan with retaliation if more attacks occur. Protesters during a demonstration against the Pakistan attacks, in Kandahar, on April 18

Pakistan’s rare airstrikes inside Afghanistan over the weekend that killed more than 40 civilians show simmering tensions with the Taliban following the U.S. withdrawal from the region.

Saturday’s cross-border strikes, the first in decades, elicited an unusually sharp response from the militant group in Kabul and a warning that more such attacks would stoke retaliation. Pakistan’s Foreign Ministry claimed only that it clashed with members of Tehreek-e-Taliban Pakistan, an off-shoot group known as TTP which operates across the border between the two countries.

Whereas previously Pakistan would share intelligence on militants with U.S. forces in Afghanistan, which then targeted them with drone strikes, now Islamabad is dependent on the Taliban to hunt them down, said Gul Dad, a research director at Pakistan Institute for Conflict and Security Studies.

“Pakistan seems to have become frustrated and has now resorted to such extreme measures,” he said. “The Taliban are also frustrated due to a lack of international recognition, especially from Pakistan.”

The spat shows the complex ties between the neighbour's, which share a porous land border stretching more than 1,600 miles (2,575 kilometers). While Pakistan for years has been home to key Taliban members and even Osama bin Laden before he was killed by U.S., the country has simultaneously battled militants in the TTP who want to establish an Islamic caliphate in Islamabad.

Deadly attacks in Pakistan have increased to the highest level in more than four years after U.S. troops left Afghanistan and the Taliban took power. Last week a Pakistani military convoy was ambushed near the border in North Waziristan, with seven soldiers and four attackers killed in a gun battle.

Still, the timing of the airstrikes raised eyebrows: They occurred just days after Shehbaz Sharif took over as prime minister and vowed to improve ties with the U.S. and Europe. His predecessor, Imran Khan, had courted closer ties with Russia, China and the Taliban, saying the militant group had “broken the shackles of slavery” after it overran Kabul and forced the U.S. to quickly depart.

Taliban Says Pakistani Airstrikes Killed Afghan Civilians

In a statement Sunday, Pakistan’s Ministry of Foreign Affairs didn’t directly acknowledge the airstrikes but said that attacks from Afghanistan have spiked significantly and Islamabad had “repeatedly requested” over the past few months that the Taliban secure the border region. “Terrorists are using Afghan soil with impunity to carry out activities inside Pakistan,” the statement added.

The Taliban summoned Pakistan’s ambassador in Kabul, Mansoor Ahmad Khan, to protest the attacks. The attacks prompted hundreds of angry civilians in the north-eastern Khost province to march and chant anti-Pakistan slogans.

Despite the animosity, it’s unlikely the tension will escalate much further, according to Rustam Shah Mohmand, a former Pakistani ambassador to Afghanistan. Still, he added, Taliban leaders may seek to lessen Afghanistan’s dependence on Pakistan and will continue to oppose a border fence that is contributing to tensions.

Pakistan built the fence along what’s known as the Durand Line, which was demarcated by the British in the 1890s and divided the homes of ethnic Pashtun tribes. The Taliban has never recognized the frontier and has destroyed parts of the fence.

“This border fencing actually is the real bone of contention,” Mohmand said. “The tribal people living across the Pak-Afghan border are closely related to each other and keep moving here and there for social and trade related purposes. All that centuries-old movements have completely halted.”

Taliban Victory In Afghanistan Fuels Terror Attacks In Pakistan

The TTP, or Pakistani Taliban, has killed more than 70,000 people over the past few decades and engineered some of Pakistan’s worst terrorist attacks, including one on an army school that killed 150 people in Peshawar in 2014.

“The idea that the Taliban would rein in TTP strikes me as a delusion,” said Gautam Mukhopadhaya, a former Indian ambassador to Afghanistan, Syria and Myanmar, who’s currently a senior visiting fellow at New Delhi-based research group the Centre for Policy Research. “Ties of blood and belief are thicker than marriages of conveniences.”