Last month, Pakistan suffered its deadliest spasm of terrorist violence since 2014. Over a period of four days in February, militants struck all four Pakistani provinces and three major urban spaces. The bloodshed culminated on February 16 with an assault on a revered Sufi shrine that killed nearly 90 people. It was the deadliest terrorist attack on Pakistani soil since a school massacre in the city of Peshawar that killed 141 people, most of them students, in 2014.

This killing spree has dangerous implications, not only for Pakistan, which has enjoyed a relative respite from terrorist violence over the last two years, but also for the broader region. Pakistan’s already tense relationship with Afghanistan has been plunged into deep crisis, with conflict a very real possibility.

The attacks in February were claimed by Jamaat-ul-Ahrar, a Pakistani Taliban faction; Lashkar-e-Jhangvi, a sectarian extremist group; and a local chapter of the Islamic State known as ISIS-Khorasan (ISIS-K). These are arguably the most active and lethal terror groups operating in Pakistan today. And according to Pakistan, they are all based in Afghanistan.

Pakistan has long accused Kabul of refusing to act against Pakistani militants on Afghan soil. It’s an ironic allegation, given that Pakistan has itself long provided sanctuary to Afghan militants that stage attacks in Afghanistan. These militants include the Afghan Taliban and Haqqani network—the two groups leading the insurgency in Afghanistan.

Islamabad has nonetheless insisted that Kabul crack down—a demand that’s grown louder ever since the Peshawar school attack. That tragedy was staged by another Afghanistan-based terrorist entity, the parent Pakistani Taliban organization. In fact, most terrorist assaults in Pakistan over the last two years—many of which have targeted the border province of Baluchistan—have been perpetrated by groups now based in Afghanistan. Many militants fled there to escape a Pakistani counterterrorism offensive launched in Pakistan’s North Waziristan tribal agency in 2014.

For Pakistan, the bloodshed last month may have been the straw that broke the camel’s back. Soon after the February 16 shrine attack, Pakistan closed two major border crossings. It gave Afghan officials a list of 76 “most wanted” terrorists on Afghan soil and demanded that Kabul deal with them immediately. Then, on February 17, the Pakistani military started shelling what it described as terrorist ecampments in Afghanistan. On February 19, Pakistani media reports claimed that the artillery shelling had destroyed “nearly a dozen” training camps and hideouts and killed “over a dozen” terrorists.

Reports from Afghanistan, however, told a very different story. The Afghan journalist Bilal Sarwary tweeted that Pakistan launched about 400 mortars into Afghanistan between February 17 and 19, with some landing in civilian areas. On February 21, a Norwegian aid group in Afghanistan claimed that 200 families had been displaced by the violence. There were no reports of civilian deaths.

Afghanistan’s Defense Ministry denounced the shelling as “an act of aggression.” The Afghan army, warning that “Afghanistan will not allow any country to conduct any kind of military intervention on its soil,” threatened retaliation. Meanwhile, on February 20, the Afghan Foreign Ministry delivered to the Pakistani government another list, this one of more than 30 terrorist camps and nearly 90 Taliban operatives allegedly on Pakistani soil—and demanded that Pakistan take action against them all.

In effect, each country is demanding that the other immediately take out or turn over terrorists on the other’s soil—a very hard sell.

Pakistan has little incentive to crack down on the Afghan Taliban and its ally, the Haqqani network, because these groups help keep India at bay in Afghanistan. Pakistan has long accused New Delhi of using Afghanistan as a base to collude with various anti-Pakistan groups—from Afghan intelligence to Baluchistan separatists—to foment unrest inside Pakistan. Today, India-Pakistan relations are in dreadful shape, thanks in great part to several mass casualty attacks on the Indian military last year that New Delhi blamed on terrorists with ties to Pakistani intelligence. Accordingly, there’s good reason to expect Pakistan to double down on its tried-and-true policy of maintaining ties to its anti-Afghanistan militant assets.

Each country is demanding that the other immediately take out or turn over terrorists on the other’s soil—a very hard sell.

Meanwhile, many Pakistanis believe that Kabul views Pakistani Taliban fighters as useful proxies to be deployed against Pakistan and willingly offers sanctuary to them. They point, for example, to the case of Latif Mehsud. In October 2013, U.S. forces in Afghanistan spotted Mehsud, a senior Pakistani Taliban leader, while he was traveling to Kabul with Afghan officials. Afghan sources told The New York Times that they were attempting to develop a relationship with the Pakistani Taliban. Additionally, research published by the Afghanistan Analysts Network last summer describes efforts by Afghan intelligence to curry favor with groups of Pakistani militants—who later declared allegiance to ISIS—in Afghanistan between 2010 and 2015. All this would suggest that Kabul, like Islamabad, has little incentive to jeopardize relationships that it views as strategically advantageous.

This theory, however, is undercut by the fact that U.S.-Afghan joint operations regularly target these very terrorists. In recent testimony to the Senate Armed Services Committee, John Nicholson, the head of U.S. forces in Afghanistan, said that in 2016 such efforts killed about a third of ISIS-K’s fighters in Afghanistan and reduced the territory it holds by two-thirds. He also noted that a U.S. air strike killed Khalifa Omar Mansoor, the mastermind of the Peshawar school massacre.

This track record suggests that Kabul will have little sympathy for Pakistan’s demands for immediate action—particularly as Afghan forces struggle to fend off Afghan Taliban fighters that Afghan officials accuse Pakistan of harboring for 15 years. In short, Afghanistan and Pakistan are in a dangerous stalemate, with no resolution in sight.

Fortunately, all-out war is unlikely. Afghanistan’s army is in no position to take on its superior Pakistani counterpart; Afghan analysts have admitted that their military lacks sufficient long-range weaponry. Meanwhile, on February 20, just after Pakistan’s three days of cross-border firing into Afghanistan, both sides offered conciliatory words and called for cooperation—suggesting that temperatures would fall a notch. Since then, there have been no reports of additional Pakistani cross-border shelling.

However, limited conflict—additional cross-border shelling from Pakistan coupled with possible retaliatory strikes from Afghanistan’s highly disciplined Special Forces—is highly likely in the future for two reasons.

First, repositories of goodwill are scarce in Afghanistan-Pakistan relations, which are tense for reasons that go well beyond cross-border terrorism. At the core of the dispute is Afghanistan’s refusal to recognize their disputed border, known as the Durand Line. Kabul also resents discrimination against Afghan refugees in Pakistan. According to the refugees, this has included denial of treatment at hospitals and frequent police harassment. Last year, moreover, Pakistan ordered several hundred thousand Afghan refugees—many of whom had lived in Pakistan for decades—to return to Afghanistan.

Repositories of goodwill are scarce in Afghanistan-Pakistan relations.

And in recent days, according to Pakistani media reports, police in Punjab Province have been ordered to pay special attention to ethnic Pashtuns and to treat them as potential terror suspects. This new move, described by the Pakistani media as “Pashtun profiling,” directly targets Afghan refugees, because most of them are Pashtuns.

Second, recent efforts at reconciliation have failed, heightening the political risks of extending new olive branches. In 2015, Afghan President Ashraf Ghani held a series of meetings with top Pakistani civilian and military officials, yielding accords to cooperate on cross-border terrorism and to train Afghan cadets in Pakistan. However, this newfound goodwill quickly evaporated amid continued attacks in Afghanistan that Kabul blamed on Pakistan-based militants. Ghani was widely criticized by the Afghan political class for reaching out to a hardened foe and gaining nothing in return.

The crisis in Afghanistan-Pakistan relations raises uncomfortable questions for the administration of U.S. President Donald Trump. If Pakistani shelling resumes and intensifies, Kabul may invoke the bilateral security agreement that governs the U.S. military presence in Afghanistan and call on American forces to help defend against Pakistani strikes. The agreement is not a defense pact that requires U.S. forces to come to Afghanistan’s aid, but it does feature an “external aggression” provision that stipulates that “in the event of external aggression . . . the Parties shall hold consultations on an urgent basis to develop and implement an appropriate response, including . . . available political, diplomatic, military, and economic measures.”

Such a scenario would present a policy conundrum for Washington. U.S. forces remain in Afghanistan to help Afghan forces, and according to the bilateral security agreement, the United States “shall regard with grave concern any external aggression or threat of external aggression against the sovereignty, independence, and territorial integrity” of Afghanistan. And yet Washington wouldn’t want to formally side against Pakistan, a nation with which the United States seeks a workable relationship.

Additionally, Kabul may call on India, a friend to both Afghanistan and the United States, to scale up military support. New Delhi has long hesitated to provide weaponry to Kabul for fear of provoking Pakistan’s ire. However, Indian Prime Minister Narendra Modi has telegraphed a willingness to be bold. In 2014, he signed off on a deal to send several Russia-manufactured fighter helicopters to Kabul—the first time India transported offensive weaponry to Afghanistan. And Afghanistan’s army chief visited New Delhi last summer to request additional lethal hardware.

In Pakistan, many observers contend that India is backing the Afghanistan-based terrorists attacking Pakistan. Stepped-up India-Afghanistan security cooperation—or mere perceptions of it—could prompt a piqued Pakistan to intensify its shelling in Afghanistan.

Washington faces the alarming prospect of an escalation in cross-border tensions involving three countries in a nuclear-armed region housing nearly 9,000 U.S. troops. It’s high time the White House announced a new policy for Afghanistan and broader South Asia—one that addresses not only U.S. troop levels but also the rising regional tensions that threaten to engulf a dangerous neighborhood. This policy should position the United States as a formal mediator in the Afghanistan-Pakistan dispute—thereby affording Trump an opportunity to help broker an accord to ease bilateral tensions. This would be a challenge, to be sure, but a challenge that Trump—who prides himself on his dealmaking prowess—should relish.