ISLAMABAD (AP) — Faced with rising violence, Pakistan is taking a tougher line to pressure Afghanistan’s Taliban rulers to crack down on militants hiding on their soil, but so far the Taliban remain reluctant to take action — trying instead to broker a peace.

Last month came a sharp deterioration in relations between the two neighbors when Pakistan carried out airstrikes in eastern Afghanistan. Witnesses said the strikes hit a refugee camp and another location, killing at least 40 civilians. UNICEF said 20 children were believed to be among the dead.

Pakistan never confirmed the April 15 strikes, but two days later its Foreign Ministry issued a sharp warning to the Taliban not to shelter militants.

The pressure has put the Taliban in a tight corner. The Taliban have long been close to several militant groups carrying out attacks in Pakistan, particularly the Pakistani Taliban, a separate organization known by the acronym TTP. The TTP and other groups have only got more active on Afghan soil since the Taliban takeover in August.

But the Taliban are wary of cracking down on them, fearful of creating more enemies at a time when they already face an increasingly violent campaign by Afghanistan’s Islamic State group affiliate, analysts say.

A series of bombings across Afghanistan in recent weeks, mostly targeting minority Hazaras, has killed dozens. Most are blamed on the Islamic State affiliate, known by the acronym IS-K. The bloodshed has undermined the Taliban’s claims to be able to provide the security expected of a governing force.

This week, the Taliban hosted talks between the TTP and a Pakistani government delegation as well as a group of Pakistani tribal leaders, apparently hoping for a compromise that can ease the pressure. On Wednesday, the TTP announced it was extending to May 30 an earlier cease-fire it had called.

The Taliban government’s deputy spokesman Bilal Karimi said it “is trying its best for the continuation and success of the negotiations and meanwhile asks both sides to have flexibility.”

But past cease-fires with the TTP have failed, and already the current one was shaken by violence last weekend.

Pakistan’s frustration appears to be growing as violence on its soil has increased.

The secessionist Baluchistan Liberation Army killed three Chinese nationals in late April. The TTP and the Afghan-based IS have targeted Pakistan’s military with increasing regularity.

Militant attacks in Pakistan are up nearly 50% since the Taliban takeover in Afghanistan, according to the Pakistan Institute of Peace Studies, an independent think tank based in Islamabad that tracks militant activities. The group documented 170 attacks between September and mid-May that killed 170 police, military and paramilitary personnel and more than 110 civilians.

The United Nations estimates that as many as 10,000 TTP militants are hiding in Afghanistan. So far, Afghanistan’s rulers have done little to dismantle militant redoubts on their territory.

Prominent Afghans from southern Afghanistan, who spoke to The Associated Press on condition of anonymity, said the Pakistani Taliban and Pakistani Baluch secessionists had established several safe houses in the area during the previous U.S.-backed government’s rule and they have remained since the Taliban takeover.

The Pakistani airstrikes in April marked a dramatically tougher stance. They came after a militant ambush killed seven soldiers near the border with Afghanistan. Pakistani and Afghani border forces often exchange rocket fire amid disputes over the frontier — but it is rare for Pakistan to use warplanes on targets inside its neighbor.

The change came after weeks of political turmoil in Pakistan that unseated Imran Khan as prime minister. Khan had been an advocate of negotiations with militants and had campaigned for the world to engage with the Taliban after their takeover in Afghanistan.

Michael Kugelman, deputy director of the Asia Program at the U.S.-based Wilson Center said Khan “had a soft spot for the Taliban as well as a principled opposition to the use of force in Afghanistan.”

With Khan now out of the picture and TTP attacks continuing, “we can expect a stronger Pakistani readiness to use military operations,” he said.

The Afghan Taliban are warning Pakistan against further military action, threatening retaliation.

The airstrikes “are not acceptable,” Taliban-appointed Defense Minister Mohammad Yaqoob warned Pakistan in late April. “The only reason we have tolerated this attack is because of our national interest, but it is possible we will not be so tolerant in the future.”

The son of the Taliban founder, Mullah Mohammad Omar, Yaqoob is a powerful figure in the Taliban leadership, which is struggling to stay united amid disagreements about how to govern their war-ravaged nation.

The leadership council seems firmly split between two camps: the pragmatists and hard-liners. Pragmatists have pushed for global engagement and opening of schools to girls of all ages. The hard-liners want to return Afghanistan to the late 1990s Taliban rule when women and girls were denied access to most public spaces and a rigid and unforgiving version of Islam and tribal rule was imposed.

A flurry of repressive edicts of late suggest the hard-liners have the upper hand, including an order that women wear all-encompassing veils that leave only the eyes visible and a decision not to allow girls to attend school past the sixth grade.

Yaqoob falls among the pragmatists, according to several prominent Afghans familiar with the Taliban leadership. Still, there seems no decision among the leaders on either side of the divide to oust militants on their territory.

“I do not see any quick fix to the Pakistan-Afghan situation. The Taliban will continue to provide sanctuary to the TTP and hope they can extend their own influence into Pakistan over time,” said Shuja Nawaz, an expert and fellow at the South Asia Center of the U.S-based Atlantic Council.

“So, expect the situation to deteriorate, especially with the (Pakistan) military calling the shots on Afghan policy,” Nawaz said.