Officials at Afghanistan's defence ministry say at least a dozen of the attackers were killed in the assault in southern Kandahar province.
Militants attacked an Afghan government army base in the southern province of Kandahar, killing at least 10 soldiers and wounding nine, defence officials said on Tuesday.
The attack began just before midnight on Monday, the Afghan defence ministry said in a statement.
Government forces at Camp Achakzai in Shawali Kot district battled for several hours, killing at least 12 attackers, ministry spokesman Dawlat Waziri said.
Nangarhar raid kills four civilians
In another incident on Monday night, at least four civilians were killed and 13 wounded during a raid by Afghan special forces in the eastern province of Nangarhar, the provincial governor said.
Among those killed were two women and a child, the governor's office said in a statement. Six children and three women were among those wounded.
Waziri said officials were aware of the report but had not confirmed it.
"An investigation is ongoing," he said.
Militants have stepped up attacks in Afghanistan in recent weeks.
Afghan forces, backed by US troops and air strikes, have been battling both Taliban and Daesh-linked forces in Nangarhar, which is on the Pakistani border.
The United States is considering whether to send 3,000 to 5,000 more military advisers to help train and assist Afghan security forces battling a 16-year insurgency led by the Taliban, and Daesh which is becoming more active in the war-weary country.