Insurgents attacked an Afghan army position near Angore Adda in Paktika province late on Sunday, triggering a four-and-a-half hour gun battle, according to Defence Ministry spokesman General Muhammad Zahir Azimi.
He said the rebels fled, leaving 28 dead bodies. Azimi said four Afghan army soldiers were injured, one seriously.
"The fighting was intense," Azimi said, adding that the army captured a lot of ammunition from the Taliban fighters, including anti-aircraft and artillery shells as well as rocket launchers.
He said no US-led coalition forces took part.
General Shorgul, deputy corps commander for the Afghan army in three eastern provinces, including Paktika, said the fighters had come across the border from Pakistan and fled back afterwards. Shorgul goes by only one name.
Pakistan denies that it allows Taliban fighters sanctuary on its soil. In recent days, its army has been fighting with tribal forces in North Waziristan on the Pakistan side of the border.
The attacks come as Afghan President Hamid Karzai said US troops in Afghanistan and the International Security Assistance Force (ISAF) should eventually work for one command under Nato.
The US, which make up about two-thirds of the foreign troops in Afghanistan, has been trying to get its European Nato allies to shoulder more of the burden of battling a stubborn Taliban-led insurgency.
On Saturday, British Defence Secretary John Reid said Nato members were not opposed to greater "synergy" with US-led forces.
But he said there were some objections among Nato allies about combining the ISAF peacekeeping operation into a single mission with the US-led Operation Enduring Freedom chasing the Taliban.
The ISAF's mission in Afghanistan
is to keep peace, not hunt fighters
Nevertheless, Karzai told Monday's edition of Le Figaro newspaper: "Sooner or later we will have a single command for the two operations and they will be under the Nato banner".
Karzai arrives in Paris for three days of talks and will meet French President Jacques Chirac on Monday. The Afghan leader said he would discuss the Nato issue in his meetings.
Separate US-Nato missions
Nato allies France, Germany and Spain last month rejected a US call for the alliance to help it fight insurgents, insisting it should stick to peacekeeping.
France and Spain said the two missions should remain separate with different chains of command while Germany said it would not like to expose its soldiers by linking the two mandates.
"We will end up by finding a solution that satisfies everybody," Karzai said.