The attack on Sunday apparently targeted a local militia commander who escaped unharmed, said Jawad Hajri, a spokesman for the governor of Takhar province.
Four others were also injured when the Taliban fighters attacked the militia base in the Lalah Gozar area of Khwaja Bahauddin district, Hajri and a provincial councillor, Rohullah Raufi, told DPA news agency.
Taliban spokesman Zabihullah Mujahid said the group’s fighters killed 21 gunmen and seized their weapons.
The attack came as Taliban officials told The Associated Press news agency that a ceasefire might be implemented in the country.
The Taliban has previously refused all offers of a ceasefire by the Afghan government, except for a three-day truce in June 2018 over the Eid al-Fitr holiday.
The current ceasefire proposal would last a week to 10 days and a peace deal with the United States would then be signed, the Taliban officials said.
Talks between Afghans on both sides of the conflict would follow to decide on the shape of a post-war Afghanistan.
The Taliban shura, or ruling council, is currently debating whether to accept the US ceasefire proposal, Taliban officials said.
The officials spoke on condition of anonymity because they were not authorised to speak to the media, but were familiar with the ongoing US-Taliban negotiations.
On Monday, a US soldier was killed in combat in the northern Kunduz province. The Taliban claimed it was behind a deadly roadside bombing that targeted American and Afghan forces in Kunduz.
The following day, a Taliban attack on a checkpoint killed at least seven Afghan army soldiers in the northern Balkh province.
Another six Afghan troops were killed in the same province on Thursday in an attack on an army base.
At least 10 Afghan soldiers were killed on Friday in a complex attack on a checkpoint in the southern Helmand province.
The Taliban frequently targets Afghan and US forces, as well as government officials. But many civilians are also killed in the crossfire or by roadside bombs planted by fighters.