Iran state radio says two men have been hanged publicly after posting a video on YouTube showing them robbing and assaulting a man with a machete on a Tehran street.

The execution was carried out Sunday after officials called for a speedy investigation and trial because of public outrage. The video emerged in early December and was later shown on state TV.

The two men, both 24, were convicted of "waging war against God," a broad charge that can cover actions ranging from anti-state organizing to violent assaults.

The semiofficial ISNA news agency says nearly 300 people witnessed the hangings.

ISNA said two accomplices received sentences that included 10 years in prison and 74 lashes each.