Mulwi Shir Ahmad Ammar, the city's deputy governor, told NBC News that the four men had kidnapped a local trader and his son on Saturday morning and had intended to take them out of the city, which sits around 500 miles west of the country's capital Kabul.
They were killed during an exchange of gunfire which had left one Taliban fighter wounded, he said, adding that their bodies were strung up "in order to be a life lesson for other kidnappers."
Authorities had set up roadblocks and checkpoints across the city to catch them, he said. NBC News was not able to independently verify his claims.
Footage of a corpse swinging on the crane in broad daylight in the city's Mostofiat Square was widely shared on social media and by news agencies. Crowds of mostly men could be seen looking up at the body.
No other bodies were immediately visible in the footage, but social media posts said others were hung up in other parts of the city.
One senior Taliban commander told NBC News that public execution was "the only solution" to deal with crimes, particularly kidnapping and murder. He was speaking on condition of anonymity because he was not officially authorized to speak.
After the group seized control of the country last month, Afghans and the world have been watching to see whether the Taliban will bring back the harsh rule of the late 1990s, which saw public stonings and limb amputations of alleged criminals, some of which took place in front of large crowds at a stadium.
Despite trying to paint an image of a more tolerant and modern regime, growing evidence has increasingly pointed to a broad and sometimes brutal crackdown by the Taliban in the weeks since the militants took back control as they settle old scores, stamp out opposition and try to force many Afghans to adhere to their strict interpretation of Islam.
Last week, Mullah Nooruddin Turabi, one of the founders of the Taliban and the chief enforcer of its harsh interpretation of Islamic law when they last ruled Afghanistan, said the hard-line movement will once again carry out executions and amputations of hands, prompting strong condemnation from the U.S.
State Department spokesman Ned Price said in a briefing Friday the U.S. would “stand firm with the international community to hold perpetrators of these — of any such abuses — accountable."
Washington has repeatedly said any recognition of the new Taliban government would be contingent on the militants upholding human rights.