Afghanistan's government on Sunday said dozens of Pakistani troops and nine Afghan soldiers were killed in a night of heavy border clashes between the two countries.

Afghanistan's Taliban forces launched attacks on Pakistani soldiers along their shared border late Saturday, in what it called "retaliation for air strikes carried out by the Pakistani army on Kabul" on Thursday night.

Islamabad has not directly claimed the strikes, but has repeatedly stated the right to defend itself against surging militancy that it says is planned from Afghan soil.

Since the Taliban seized control of Afghanistan in 2021, the two sides have repeatedly clashed in border regions, but airspace violations deep into Afghan territory would mark a significant escalation.

Zabihullah Mujahid, the Taliban government spokesman, on Sunday told a press conference that 58 Pakistani soldiers were killed and around 30 wounded in clashes, while nine Taliban forces were killed.

Pakistan has not given any official death toll and AFP was unable to independently verify the casualty figures.

Mujahid told reporters that "we stopped the retaliation at midnight" as a result of mediation by Riyadh and Doha, and accused Pakistani troops of attacking Afghan forces early Sunday.

Saudi Arabia, Iran and Qatar have urged both sides to "exercise restraint".

A military unit described Thursday's blasts in the Afghan capital as "air strikes", but Mujahid instead said the incident was an "airspace violation", adding that no damage had been found.

- 'Strong' response -

Following the overnight clashes, Pakistan Prime Minister Shehbaz Sharif said he "strongly condemns provocations" by Afghanistan.

"There will be no compromise on Pakistan's defence, and every provocation will be met with a strong and effective response," Sharif said in a Sunday statement, accusing Taliban authorities in Afghanistan of allowing their land to be used by "terrorist elements".

The Afghan military said on Saturday night that Taliban forces were engaged "in heavy clashes against Pakistani security forces in various areas".

Key border crossings between the countries were closed on Sunday, officials said.

Extra troops have been sent to the major border crossing at Torkham, which sits on the frontier between Kabul and Islamabad.

Pakistani officials at Torkham, who requested anonymity, told AFP there had been no casualties on their side of the border crossing and that no further clashes had been reported in the area on Sunday morning.

Several border security officials told AFP that no further clashes had been reported at major crossings on Sunday morning.

- Resurgent violence -

Militancy increased in northwestern Khyber Pakhtunkhwa since the withdrawal of US-led troops from neighbouring Afghanistan in 2021 and the return of the Taliban government.

The vast majority of attacks are claimed by the Pakistani Taliban (TTP), whose campaign against Pakistan security forces has intensified this year -- set to be the deadliest in more than a decade.

The TTP is a separate but closely linked group to the Afghan Taliban, which Islamabad says operates from Afghan soil with impunity.

A UN report this year said the TTP "receive substantial logistical and operational support from the de facto authorities", referring to the Taliban government in Kabul.

More than 500 people, including 311 troops and 73 policemen, have been killed in attacks between January and September 15, a Pakistan military spokesman said on Friday.

Pakistani Defence 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," he said. "The Pakistani government and army's patience has run out."