Local militias often work with overstretched security forces in Afghanistan.
The violence in Baghlan came as the US and the Taliban officials were due to start a new round of talks in Qatar to end the 18-year-long US presence in Afghanistan.
The talks, in its seventh round, have centered on four issues: counter-terrorism, the foreign troop presence, an intra-Afghan dialogue, and a permanent ceasefire.
US officials have previously said they are hoping for a deal before the upcoming Afghan presidential elections, which have already been delayed twice and are now set for September.
On Tuesday, the US Secretary of State Mike Pompeo paid an unannounced visit to Kabul and hoped for a peace deal with the Taliban “before September 1”.