Pakistan closed key border crossings with Afghanistan on Sunday after fierce clashes erupted overnight following Taliban accusations that Islamabad carried out air strikes earlier in the week, officials said.
Afghanistan and Pakistan have had frosty relations since the Taliban returned to power in Kabul in 2021.
Islamabad accuses authorities there of harboring militants carrying out strikes on its soil, an accusation Afghanistan denies.
Afghan Taliban forces attacked Pakistani soldiers along their shared border Saturday night, accusing Islamabad of violating its sovereignty after explosions were heard in Kabul and in the southeast two days earlier.
Officials from both sides of the border told Agence France-Presse (AFP) on Sunday that crossings at Torkham, which connects Pakistan's Khyber Pakhtunkhwa province with Nangarhar in Afghanistan, and Chaman, more than 800 kilometers (497.07 miles) to the southwest, were closed.
At least three minor crossings at Kharlachi, Angoor Adda and Ghulam Khan were also closed, local officials said.
Pakistani Prime Minister Shehbaz Sharif condemned what he said were "provocations by Afghanistan" along Pakistan's border area overnight.
"There will be no compromise on Pakistan's defense, and every provocation will be met with a strong and effective response," Sharif said in a statement, accusing Taliban authorities in Afghanistan of allowing their land to be used by "terrorist elements."
A senior Pakistani official in Torkham told AFP on Sunday that extra paramilitary troops had been sent to the area, which sits on the border between Kabul and Islamabad.
"The Torkham border has been completely closed for pedestrian movement and trade," said the official, who spoke on condition of anonymity because he was not authorized to speak to the media.
"Security forces have also pulled out all civilian staff posted at the border, so they are not harmed in case of further firing," the official added.
Another Pakistani border official at Chaman, which links Balochistan province with Kandahar, the birthplace of the Afghan Taliban, said the crossing was "sealed."
Other Pakistani officials said there had been clashes using heavy weapons in at least four border districts, but there had been no casualties on their side.
Afghanistan administration spokesman Zabihullah Mujahid claimed in a press statement that 58 Pakistani soldiers were killed and 30 wounded in the clashes.
Mujahid said more than 20 people died on the Afghan side and that clashes stopped at the request of Qatar and Saudi Arabia.
Pakistan state television PTV News, citing security sources, claimed Pakistani forces captured 19 Afghan border posts.
Those found in the captured posts were killed, Afghan forces abandoned and fled some posts, and fires broke out in some posts, according to the report.
The Afghan military said Saturday night that Taliban forces were engaged "in heavy clashes against Pakistani security forces in various areas."
Afghan Defense Ministry spokesman Enayat Khowarazm told AFP that the "successful" operations had ended at midnight. Several border security officials told AFP that no further clashes had been reported Sunday morning.
However, in Pakistan's Kurram area, intermittent gunfire continued, according to local officials and residents.
Afghanistan's defense ministry announced in a statement that "retaliatory and successful operations against Pakistan were stopped as of midnight" but reiterated that it is ready to defend the country's territory with determination.
"There is no kind of threat in any part of Afghanistan's territory," Mujahid said Sunday.
Militancy has surged in Khyber Pakhtunkhwa since the withdrawal of U.S.-led troops from neighboring Afghanistan in 2021 and the return of the Taliban government.
More than 500 people, including 311 troops and 73 policemen, have been killed in attacks between January and Sept. 15, a military spokesman said Friday.
The Pakistani air strikes, not officially acknowledged by Islamabad, had targeted the leader of the Tehreek-e-Taliban Pakistan (TTP) militant group in Kabul on Thursday, according to a Pakistani security official.
A U.N. report this year said the TTP "receives substantial logistical and operational support from the de facto authorities," referring to the Taliban government in Kabul.
Pakistani Defense Minister Khawaja Muhammad Asif told parliament on Thursday that several efforts to convince the Afghan Taliban to stop backing the TTP had failed.
"Enough is enough," Asif said, adding, "The Pakistani government and army's patience has run out."
Saudi Arabia, Iran and Qatar have urged both sides to "exercise restraint."