At least 18 Afghan soldiers and members of the special forces have been killed in fighting in the western province of Farah, local officials said on Saturday.
Taliban fighters attacked troops assembled to prepare an attack in Bala Buluk district in the night, setting off a fierce battle, officials said.
Defence Ministry spokesman Dawlat Waziri said four members of the special forces had been killed and a number wounded, but the head of the local provincial council, Farid Bakhtawar, said the death toll had reached at least 18.
As the fighting went on, an air strike was called in and killed around 25 insurgents, he said.
In a message posted on Twitter, a Taliban spokesman said 53 commandos had been killed or wounded after arriving in Tapa Sadat, close to the Bala Buluk district center, and a sizeable quantity of weapons seized.
US and Afghan officials say the Taliban have been under increasingly heavy pressure from air strikes and army operations but the insurgents have repeatedly demonstrated their ability to inflict severe damage on Afghan security forces.
This week's incident was the latest in a series to have hit Farah province, between the border with Iran and the Taliban heartland of Helmand province, source of much of Afghanistan's opium crop.
It came ahead of an expected increase in fighting with the end of winter and the approach of spring.