Officials in Pakistan have been indignant. Khawaja Asif, the country’s foreign minister, said on Twitter that Pakistan’s coming response “will let the world know the … difference between facts & fiction.” He added: “Trump quoted figure of $33billion given to PAK over last 15yrs, he can hire a US based Audit firm on our expense to verify this figure & let the world know who is lying & deceiving.” On Monday, David Hale, the U.S. ambassador to Islamabad, was summoned to the foreign ministry to explain the president’s remarks. Following a three-hour meeting held by Pakistan’s National Security Committee over Trump’s tweet, the committee released a statement calling the allegations “completely incomprehensible as they contradicted facts manifestly, struck with great insensitivity at the trust between [the] two nations built over generations, and negated the decades of sacrifices made by the Pakistani nation.”

Pakistan, for its part, maintains that it has moved against militants whenever the U.S. has provided it with relevant intelligence. But the killing by U.S. Navy SEALs of Osama bin Laden, the al-Qaeda leader, in a military garrison town in 2011, and the presence of other known militants on Pakistani soil has resulted in some skepticism about that assertion. Pakistan also points out it has suffered disproportionately at the hands of terrorist groups. It says it has little control over the porous border that divides its territory from Afghanistan’s, allowing militants to travel back and forth easily. It’s unclear whether this is due to Pakistan’s inability to stop the flow, or its unwillingness to do so.

What is perhaps most significant is that Pakistan views the Taliban as an ally, and is believed to provide safe haven to many of its senior leaders. The U.S., which ousted the Taliban regime during the invasion of Afghanistan in 2001, has been trying to bring stability to the country for the past 16 years. Yet the group now controls more of Afghanistan than at any point since the U.S.-led invasion. Its fighters have continued to wage a military campaign, attacking U.S. and Afghan troops, foreign embassies, government facilities, and civilians. Any lasting political stability in Afghanistan depends on either the defeat of the Taliban—unlikely at this point—or its integration into the political process. But Pakistan’s support of the group all but ensures that it will have little incentive to join talks with the Afghan government.

Ultimately, as far as the Taliban is concerned, Washington and Islamabad have competing interests. Pakistan is not interested in being sandwiched between two unfriendly nations—Afghanistan and India. The Taliban gives Pakistan enough leverage inside Afghanistan to maintain its regional interests. It is this difference in how the Taliban is viewed—detrimental to Afghan stability versus pivotal to Pakistan’s regional interests—that underlie the misunderstanding between the U.S. and Pakistan.

“Trump is disappointed at the U.S. defeat in Afghanistan,” Asif, the foreign minister, told GEO TV, “and that is the only reason he is flinging accusations at Pakistan.”