At least seven police officers have been killed in clashes with Taliban militants in the central Afghan province of Wardak, officials say.
The Taliban fighters set fire to a government building in Sayeed Abad district and killed the district police chief along with six other officers late on October 6, a spokesman for the provincial governor said.
The spokesman, Abdul Rahman Mangal, said the Taliban destroyed checkpoints and cut power to some parts of the city.
Afghan security forces repelled the attack but gunbattles were still under way, Mangal added.
He said there were also casualties on the Taliban side.
A statement from Taliban spokesman Zabihullah Mujahid said the militants seized the center of Sayeed Abad and the surrounding security checkpoints.
Provincial council member Haji Ahmad Jaffari also said that the Taliban already captured the district and that reinforcements from the provincial capital, Maidan Shar, were on their way.
However, another council member, Hussain Ali Ballegh, denied that.
Some reports said the attackers destroyed a highway bridge, cutting off road traffic between the national capital, Kabul, and the provinces of Ghazni, Zabul, and Kandahar.
Taliban militants and the extremist group Islamic State have a staged a number of deadly attacks across Afghanistan ahead of nationwide parliamentary elections set for October 20.
More than 2,500 people, including 418 women, are competing for the 249 seats in Afghanistan's lower house of parliament, the Wolesi Jirga.
Some 54,000 members of Afghanistan's security forces will be responsible for protecting polling centers on election day.
More than 2,000 polling centers will be closed for security reasons.
Afghan security forces have struggled to counter attacks from militant groups since the withdrawal of most NATO combat troops in 2014.