The Taliban have launched their first attack on Afghan forces since their ceasefire for the Eid festival expired.
The defence ministry says 13 soldiers died in the assault on an army check point in the western province of Badghis, while local officials put the death toll higher.
The Taliban ended their three-day truce on Sunday night – as the Muslim festival of Eid al-Fitr ended.
The government said it would continue to observe a unilateral ceasefire.
According to defence ministry figures, 13 soldiers were killed and eight injured when Taliban fighters attacked the check point overnight. The Taliban also suffered casualties, the statement says. But the head of provincial council, Abdul Aziz Bek, said that as many as 30 soldiers had died.
The Eid ceasefire saw unprecedented scenes in Afghanistan, as soldiers and Taliban insurgents hugged one another. But on Sunday the militants said the ceasefire would not be extended. President Ashraf Ghani said the government would continue its unilateral truce for 10 days.
The ceasefire was the Taliban’s first since the government it ran was toppled in a 2001 US-led invasion. Tens of thousands of Afghans have been killed since then.
In February, Mr Ghani offered the militants peace talks “without preconditions” and recognition of the Taliban as a legitimate political group if they respected the rule of law.