The men were convicted and sentenced to death in Afghan courts for a variety of crimes, including murder, rape, kidnapping, robbery and cruelty against children.
The Taliban condemned the hangings, saying the detainees were prisoners of war who were unjustly jailed.
Shahidullah Shahid, a spokesman for Wardak province, said the blast went off shortly before 7:30 am (local time) on a street where international and Afghan security forces have a coordination office. He said at least two people were killed and 60 others were wounded in the explosion.
The Taliban said two suicide bombers were involved in the attack in Maidan Shahr, the capital of Wardak province.
The insurgent group claimed the two attackers killed tens of Afghan and international troops, although the Taliban often exaggerate the number of casualties caused in their attacks.
Afghan and international forces have been working to root out insurgents in Wardak province to keep them from moving north into the Afghan capital.
The international forces are scheduled to turn over security responsibility to local troops by the end of 2014.