KANDAHAR, Afghanistan — Taliban suicide bombers penetrated a key government military base in southern Afghanistan on Friday, in a major attack that inflicted heavy casualties on the eve of the latest round of Afghan peace talks, local authorities said.
The early-morning assault came as American and Taliban negotiators prepared to resume peace talks in Doha, Qatar, on Saturday after a two-day break.
Afghanistan’s Ministry of Defense reported at least 23 members of the Afghan security forces were killed and 16 were wounded during an hourslong siege of Camp Shorab military compound in Helmand Province. Eight suicide bombers and numerous other attackers were involved, it said.
Mirza Hussain Alizada, a member of the Helmand provincial council, put the death toll higher, saying up to 40 Afghan soldiers were killed.
“It was a cruel attack,” Mr. Alizada said.
By nightfall, Afghan forces had killed most of the attackers at the base, local officials said late Friday, but a battle continued against others still inside it. Mr. Alizada said up to 30 Taliban attackers, some wearing military uniforms, stormed the base.
Omar Zwak, a spokesman for the Helmand governor, offered a slightly different account. He said late Friday that the battle had ended and all 20 Taliban militants had been killed. He detailed how several militants detonated explosive vests, breaching the defenses as other Taliban rushed inside.
Bashir Ahmad Shakir, another member of the provincial council, said the attackers split up once inside the base, making it difficult for the military to locate them. The Afghan garrison commander was killed, he said.
“The attack brought catastrophe to the corps,” Mr. Shakir said, referring to the Afghan National Army’s 215th Corps stationed at Camp Shorab.
The site was once a major base for United States forces in Afghanistan, and an adjoining part of the compound still houses American troops. Col. Dave Butler, an American military spokesman in Kabul, said on Twitter that there were no American casualties.
United States Marines who train Afghan security forces maintain a small, fortified compound within the base, and American Special Forces soldiers who train Afghan commandos are also deployed in another small compound within the base.
The Marines retrieved advisers from the base’s Afghan military operations center, a Defense Department official in Washington said.
Bad weather meant American air support was limited, but Marine Corps guard towers returned fire on the attacking Taliban, and American Special Forces helped retake parts of the base, according to Defense Department officials.
Colonel Butler, the American spokesman, wrote in a separate tweet that government forces had repulsed the attack and said a Taliban claim that the assault killed American troops amounted to “more lies” from the group.
“Who do the Taliban fight for?” Colonel Butler wrote. “Stop fighting your own countrymen and get serious about peace.”
In a statement late Friday night, the American military command said the adjoining American base had its own security perimeter, “which never came under serious threat.” The statement added that the Afghan flag still flew over Camp Shorab and that all Taliban attackers were dead.
Known then as Camp Leatherneck and Camp Bastion, the compound served as a base in southern Afghanistan for American-led coalition forces before President Barack Obama withdrew most combat troops from the country in 2014. With the war now in its 18th year, some 14,000 American troops remain.
Since peace negotiations with the Taliban began last fall, fighting has intensified, as both sides seek leverage at the talks.