The execution took place in Herat province in the presence of Deputy Prime Minister of Afghanistan Abdul Ghani Baradar, several ministers and hundreds of spectators.
The executioner was the victim's father, who personally shot the killer.
In November, the supreme leader of the Taliban, Haibatullah Akhundzada, ordered Afghan judges to be guided by Sharia law when conducting trials and passing sentences.
This means public executions, stoning, beheadings and limbs as punishments for crimes.
According to the statement of the Supreme Court of Afghanistan, 19 people found guilty of various crimes were publicly beheaded in November, including nine women.
The UN Human Rights Office strongly condemned this type of punishment and called for an immediate end to public floggings.
Although the Taliban promised softer rule than in the 1990s after returning to power last August, it is returning to a theocratic dictatorship.
Since the "Taliban" came to power in Afghanistan last year, footage of public executions of offenders - they were beaten with sticks - appeared in the media and social networks.
The Taliban police also put on public display the bodies of criminals who are said to have died in custody.
The Taliban government is repressing Afghans who previously worked for or cooperated with NATO military units and international organizations stationed in the country, for example as drivers or freelance translators.
Also, in Afghanistan, women's rights to education, work, public activity and free movement are severely restricted.