The Taliban left behind explosives that then killed four tribal elders who had come to help collect the soldiers’ bodies, according to Afghan officials.
Safder Mohsini, head of the provincial council in Baghlan, said the group also abducted two soldiers and wounded three others in the attack.
He said Taliban fighters burned down the base before planting bombs around it.
The Taliban claimed responsibility for the assault and said they seized ammunition from the base.
The group carries out near-daily attacks, mainly targeting Afghan security forces stationed in rural outposts.
Taliban fighters have ramped up attacks on Afghan security forces and government facilities in recent months, leaving troops thinly stretched throughout the country.
The latest phase of Afghanistan’s decades-old war began in 2001, when the US-led troops overthrew the Taliban government in the wake of the September 11 attacks on the United States.
A US watchdog agency said last week that the Afghan government was struggling to recover control of districts lost to the Taliban while casualties among security forces had reached record levels.
The government had control or influence over 65 percent of the population but only 55.5 percent of Afghanistan’s 407 districts, the Special Inspector General for Afghanistan Reconstruction (SIGAR) said in a report.
Russia invited 12 countries and the Taliban in an attempt to “open a new page” in Afghanistan’s history.
The Kabul government did not send a delegation.
Instead, members of the HPC, a government-appointed body responsible for reconciliation efforts with the Taliban, attended the event, where they repeated Afghan President Ashraf Ghani‘s offer of peace talks without preconditions.
The meetings ended without the sides agreeing on a path to direct dialogue, the delegations from the Taliban and HPC said.