Farid Akhizai, a provincial council member in Badghis Province, said on Wednesday that the Taliban militants encircled the soldiers -- who were airdropped into the Ab Kamari district to arrest a designate district governor of the militant group -- and killed 18 of them, Presstv Reported.
He added that the Taliban captured 11 other soldiers during the overnight clashes. Ten remain missing.
The district governor of Ab Kamari blamed the lack of coordination for the casualties.
"The operation was conducted to raid a hideout used by several Taliban commanders, but the insurgents had evacuated the area two days before," Khudad, who goes by one name, said.
The Taliban confirmed in a statement that they had received a tip-off about the raid.
But the group claimed that its militants killed 39 Afghan soldiers and captured 16.
The US and its allies invaded Afghanistan under the guise of the war on terror in 2001. While the invasion ended the Taliban's rule in the country, it has failed to eliminate the militant group. Some 18 years on, Washington is seeking truce with the militants as they have boosted their campaign of violence across the country.
Washington is currently engaged in direct talks with the militants, who are against including the Kabul government in the peace process. The peace efforts have not stopped Taliban from launching attacks.