At least five people were killed and nine others were injured in the incident, which lasted for almost an hour in the northern Jawzjan province.
Afghan national security forces helped the former Taliban members repel the attack in the Tor Oghli area of Qosh Tepa district.
“Qari Lutfullah, one of the commanders who had joined the peace process was also killed during the ambush,” provincial police chief Faqeer Mohammad Jawzjani said.
Taliban militants assassinated an ex-Taliban commander earlier this week in Jawzjan province for joining the Afghan government.
Tens of Taliban militants, who had renounced violence, joined the peace process in the province.
“As part of the tireless efforts of Afghan VP Gen. Abdul Rasheed Dostum, a group of 100 Taliban militants laid down their weapons on Wednesday and joined the peace and reconciliation process in Jawzjan province,” Sultan Faizi, Dostum's media adviser told The Anadolu Agency.
The Afghan government, in 2005, established a peace body dubbed the Afghanistan National Independent Peace and Reconciliation Commission, to back efforts of building lasting peace and assist Taliban insurgents who renounce violence.
Many Taliban fighters have surrendered, but it seems that there has been no decline in the group's activities.
Although Taliban insurgents have failed to take control of any major city in Afghanistan during in the past 13 years of fierce fighting, the shadow of their presence can be felt in many remote areas.
Afghan president Ashraf Ghani said he is serious about bringing peace to the country on Thursday, as he addressed a ceremony to mark the transition of security responsibilities from NATO to Afghan security forces.
“The Afghan-led peace process will move forward with the help of our international partners,” Ghani said.
The NATO-led International Security Assistance Force ended its 13-year combat mission in Afghanistan Sunday.
Starting Jan. 1, 2015, the mission now focuses on training and advising Afghan security forces. The 13,000 foreign troops for the Resolute Support Mission are from 28 NATO allies and 14 other partner nations.