An Afghan National Army operation - initially run independently of Nato - in the eastern province of Laghman went "disastrously wrong", officials say.
They say that what should have been a routine "mopping up" operation turned into a "major confrontation" after the Taliban launched an ambush.
Defence officials told the BBC that at least seven Afghan soldiers had been killed and 14 injured.
They say that Nato troops and air support have now joined the fighting.
Officials say that while troops were caught by surprise in the Taliban ambush, they have now fought back and inflicted heavy casualties on the insurgents over the last few days.
The BBC's Bilal Sarwary in Kabul says that questions are bound to be asked as to why the Afghan National Army (ANA) went into a remote and mountainous area - known to be Taliban and al-Qaeda strongholds - initially without Nato support.
Our correspondent says the fact the the ANA had to call on Nato ground and air support will be something of an embarrassment to it and coalition forces.
The ANA now has over 130,000 soldiers, and both its commanders and Nato leaders have said that it is increasingly able to operate independently of coalition forces.
Officials say that the ambush took place Bad Pakh valley, close to the border with Nuristan and Kunar provinces, after the ANA sent a battalion of about 300 men last week to flush the Taliban out of a rugged area.
Defence officials say the ferocity of the ambush was made worse by bad weather, which meant that the attacked soldiers could not call on air support.
Afghan defence ministry spokesman Zahir Azimi told the BBC that ANA operations like the one in Laghman routinely take place ahead of parliamentary elections.
"But there were some tactical mistakes," he said, "and the weather was also a problem."
Gen Azimi said that both the Taliban commander responsible for the attack and his deputy were killed - along with 10 other insurgents, including six foreign fighters.
"After we killed the commander there has only been sporadic resistance. Our forces have surrounded the area and we are closing in on the enemy,'' he said.
The Taliban say that they killed 27 Afghan soldiers, wounded 14 and captured eight men, while 18 army vehicles and six tanks were seized.
A defence ministry spokesman told the BBC that while some soldiers were still missing, officials have been in contact with them "and we are closing in on the area to get them back".