Taliban insurgents targeted an Afghan army corps at their camp in the southern Helmand province, killing at least 23, officials said Saturday.
Omar Zwak, spokesman for the provincial governor, said 20 other troops were wounded in the attack that began Friday and ended Saturday evening after a 40-hour battle in the Wahser district.
The death toll could rise after a final assessment, added Zwak.
As many as 40 security forces may have been killed, according to a provincial official who spoke anonymously as he was not authorized to brief the media.
Zwak added that military vehicles and offices were damaged by blasts and shooting in the attack.
Qari Yusouf Ahmadi, a Taliban spokesman, said in a statement that the insurgent group was responsible for the attack, which came even as Taliban negotiators met for talks with a U.S. peace envoy in the Middle Eastern state of Qatar.
He said Taliban fighters engaged both Afghan and foreign forces inside the camp and killed “scores.”
Zwak said U.S. advisers were present in the base, but in a separate area.
“The foreign forces present at the base were all safe as the Taliban could not reach that part of the compound,” he said.
Zwak said the attack began when a suicide bomber detonated his explosives at Shorab camp.
He said three other suicide bombers also blew themselves up as gunmen followed behind them. Zwak said 22 Taliban gunmen were killed in the fighting.
In recent years, the Taliban and the Islamic State group have carried out near-daily attacks in Afghanistan, mainly targeting the government and its security forces.