According to the local officials, the incident took place in Jund district on Tuesday evening after an Afghan soldier opened fire on his comrades.
A member of the provincial council said another soldier was also wounded in the attack and the assailant was also killed after the other soldiers responded to his fire.
The main motive behind the insider attack has not been ascertained so far but numerous such incidents have been reported across the country during the recent months.
Earlier, at least 6 policemen lost their lives in an insider attack carried out by three of their comrades in Charchino district of Uruzgan province.
A policeman also killed his 8 comrades in a similar attack in a check post located on Kabul-Kandahar highway in Zabul province last month.
The Taliban insurgents and militants belonging to the insurgent groups are actively operating in a number of remote districts of Badghis and often carry out insurgency activities.