At least 26 Afghan soldiers have been killed and 13 wounded in a Taliban attack on a military base in southern Kandahar province, the defence ministry said on Wednesday.
The militants "attacked an army camp in Karzali area of Khakrez district of Kandahar last night", ministry spokesman General Dawlat Waziri said.
Afghan soldiers "bravely resisted", he added, killing more than 80 insurgents.
Residents in the area described an hours-long attack launched by a 30 vehicle-strong convoy carrying "hundreds" of Taliban who assaulted the base from multiple directions.
Air support was called in, several residents said, though that was not immediately confirmed by officials.
The insurgents claimed the attack via their Twitter account. The resurgent Taliban have been ramping up their campaign against beleaguered government forces, underscoring rising insecurity in the war-torn country during the summer fighting season when the warmer weather tends to spur an increase in militant attacks.
Afghan security forces — beset by a high death toll, desertions and non-existent "ghost soldiers" on the payroll — have been struggling to beat back insurgents since US-led Nato troops ended their combat mission in December 2014.
Casualties among Afghan security forces soared by 35 per cent last year, with 6,800 soldiers and police killed, according to US watchdog Sigar.
The insurgents have carried out more complex attacks against security forces this year, with Sigar describing troop casualties in the early part of the year as "shockingly high".
In April, at least 135 soldiers are believed to have been killed on a base outside the northern city of Mazar-i-Sharif, one of the deadliest ever Taliban attacks on a military installation.
Some sources put the toll as high as 200. And in early March, gunmen disguised as doctors stormed the Sardar Daud Khan hospital, the country's largest military hospital, in Kabul, killing dozens.
The Taliban have a heavy presence in poppy-growing Kandahar province and have launched repeated attacks on security forces there, including multiple assaults on military bases in May which killed dozens of soldiers.
A recent UN report showed that Kandahar, which lies on the border with Pakistan, was also one of the most dangerous places in the country for civilians.
More than 70 villagers were kidnapped by the Taliban in recent days, officials said.
Seven were found dead and some 30 returned, while Afghan police have launched a search and rescue operation for the remainder of the missing.
Afghan forces now control 59.7 per cent of the country, up from 57.2 per cent the previous quarter, according to Sigar.
The Taliban and other insurgent groups, meanwhile, saw their areas of control or influence increase slightly from about 10 per cent to 11.1 per cent.