Members of the Taliban stand at the site of the execution of three men in Ghazni province, Afghanistan, April 18, 2015. Reuters

A university student was killed by hanging in Afghanistan over the weekend in a brutal display of violence from the Taliban. The man was publicly executed in a village west of Kabul for allegedly killing a high-ranking Taliban officer.

The student, Faizul Rehman, a fourth-year student at the Kabul Polytechnic University, was visiting his family in his home village of Sewaka when he was captured. It's unclear if he was involved with any acts of violence against the Taliban. Afghanistan's Interior Ministry said Saturday officials had opened an investigation into the hanging "to arrest and punish the perpetrators of this criminal act."

"He wanted to spend his vacation at home but was captured on Thursday by local Taliban and they hanged him in public," government spokesman Abdul Rehman Mangal said. "As soon as we got information, we tried to help him but the Taliban hanged him immediately."

The Taliban claimed the death was a retribution for the recent assassination of one of its leaders. "They accused him of killing Mullah Mirwais, the head of their intelligence in the area," Mangal added.

The Taliban once made global headlines for its public executions, killing organizing public hangings, lashings and stonings in front of large crowds gathered at football stadiums. These days, the group controls about a third of Afghanistan and challenges the authority of the Western-backed government in Kabul.

The Taliban is also investigation Rehman's death. "Once we finish our investigation and fact-finding, we will share the details," said Zabihullah Mujahid, the main spokesman for the Taliban movement.

The Afghan government has also taken to killing Taliban militants by hanging. Most recently, Afghan officials hanged six Taliban prisoners in May after President Ashraf Ghani vowed to crackdown on the insurgents.

Those killed were found guilty of crimes against "civilian national security," officials said at the time, adding that Ghani was acting on the "repeated demands of the families of victims of terrorist attacks."

Ghani has said he is not interested in a peace deal with Taliban leaders.