Pakistan and Afghanistan announced on Sunday that dozens of fighters were killed in border clashes that occurred the night before last, marking the deadliest fighting between the neighbors since the Taliban took power in Kabul.

The Pakistani army reported 23 of its soldiers killed, while the Taliban said nine Afghan fighters were killed. Tensions escalated after Islamabad demanded the Taliban take action against militants who intensified attacks in Pakistan, allegedly operating from Afghan territory, which the Taliban deny.

Each side claimed to have inflicted far greater casualties on the other. Pakistan said it killed over 200 Taliban fighters and their allies, while Afghanistan claimed to have killed 58 Pakistani soldiers.

Taliban officials said Islamabad launched airstrikes in Kabul and on a market in eastern Afghanistan on Thursday, prompting retaliatory attacks by the movement. Pakistan has not officially acknowledged these airstrikes.

Afghan forces opened fire on Pakistani border positions late Saturday, and Pakistan responded with small arms and artillery fire, with both countries destroying several border posts of the other.

Firing largely ceased by Sunday morning, though intermittent gunfire continued in Pakistan’s Kurram area. The Afghan Defense Ministry earlier announced the end of its operation at midnight local time.

Kabul announced it halted attacks at the request of Qatar and Saudi Arabia, both of which expressed concern over the clashes. Iranian Foreign Minister Abbas Araghchi called on both Afghanistan and Pakistan to exercise restraint, emphasizing that stability between the two contributes to regional stability.

Pakistani Prime Minister Shehbaz Sharif vowed a strong and effective response to any provocation, accusing the Taliban authorities of harboring “terrorist elements.” Interior Minister Mohsin Naqvi said Afghanistan is “playing with fire and blood,” threatening a strong response similar to the fierce confrontation with India in May.

Taliban government spokesman Zabihullah Mujahid said on Sunday, “There is no threat in any part of Afghan territory. The Emirate and the Afghan people will defend their land and remain steadfast and committed to this defense.” He added that fighting continues in some areas.

Pakistani officials said Islamabad closed border crossings with Afghanistan, which stretch 2,600 kilometers along the disputed Durand Line drawn by the British in 1893. Local officials reported the closure of the main crossings at Torkham and Chaman, as well as at least three smaller crossings in Kharalachi, Angoor Ada, and Ghulam Khan.