Insurgents dug a tunnel in volatile Sangin district and then blew it up before their fighters could attack the compound.
Ten Afghan soldiers were killed in a Taliban attack on a military base in the southern province of Helmand on Saturday, officials said.
The Taliban dug a tunnel into the base in volatile Sangin district and then blew it up before their fighters could attack the compound, said Nawab Zadran, a spokesman for 215 Maiwand Army Corps in southern Afghanistan.
"There were 18 soldiers in the base at the time of the attack providing security for the people of Sangin. Four soldiers were wounded and four repelled the Taliban attack bravely," he said.
Provincial spokesman Omar Zawak confirmed the attack and said the soldiers were killed by the powerful blast inside the base.
Taliban spokesman Zabihullah Mujahid in a statement sent to media claimed responsibility for the attack.
The attack in Helmand comes as local and international forces brace for another deadly winter amid US-Taliban talks to end the violence in Afghanistan.
On Tuesday, seven Afghan soldiers were killed in a Taliban attack on a base in the northern province of Balkh.
Winter once marked a slowdown in the so-called "fighting season", with Taliban fighters returning to their villages while snow and ice made attacks more difficult to pull off.
But in recent years, the distinction between seasons has all but vanished.
Deadly violence continues to grip Afghanistan even as the US and the Taliban negotiate on-off talks aimed at reducing America's military footprint in the country in return for the insurgents ensuring an improved security situation.