At least 25 Afghan soldiers were killed as they repelled an attack on Friday by the Taliban on a military base in Helmand province in southern Afghanistan, officials said.