Amruddin Wali, a member of the provincial council in Kunduz in northern Afghanistan, said 15 members of the paramilitary border police were killed when Taliban fighters attacked a checkpoint in Qala-e Zal district.
Taliban spokesman Zabiullah Mujahid put the casualty total at 25 and said seven police were wounded.
The latest violence follows increasing pressure by the Taliban on Kunduz, the northern city they twice overran in 2015 and 2016. The city has remained relatively secure over the past two years, but the insurgents control many of the surrounding districts.
Earlier, Afghan special forces, backed by air strikes, killed at least 21 Taliban, including senior commanders, as they gathered to plan attacks aimed at disrupting parliamentary elections on Oct. 20, the National Directorate of Security said in a statement.