A teenage student has been executed in Iran for anal sex with another boy, Amnesty International has revealed.

Hassan Afshar was convicted of rape. But Amnesty says it may have been a case of consensual gay sex.

Afshar, 19, was hanged in Arak Prison in Markazi Province on 18 July, after being convicted of “lavat-e be onf” (forced male-to-male anal intercourse).

Afshar was arrested in December 2014 after the authorities were told by parents of the other boy that he had raped their son.

They also accused two other youths of forcing the teenage boy to have sex, alongside Afshar.

Afshar says the sexual acts were consensual and the other teen had willingly engaged in same-sex sexual activities before.

In Iran, men and boys who engage in same-sex anal intercourse face different punishments depending on whether they’re the ‘top’ or ‘bottom’ partners.

Courts also consider whether their conduct is consensual or non-consensual.

If consensual, the ‘passive’ partner faces a death sentence. The ‘active’ man in consensual sex is sentenced to death only if he is married or if he is not a Muslim and the ‘passive’ partner is a Muslim.

If the intercourse is deemed non-consensual, the ‘top’ receives the death penalty but the ‘bottom’ is exempt from punishment and treated as a victim.

As Amnesty warns, this breeds false accusations. If authorities start to investigate a consensual passive partner, that boy’s best way out of the death sentence is to falsely accuse his lovers of rape.

Amnesty adds: ‘While the authorities must always investigate allegations of rape and prosecute those responsible in fair trials, rape does not fall into the category of offences for which the death penalty can be imposed under international law.

‘Furthermore, the criminalization of same-sex sexual activity between consenting adults violates international human rights law.’

Afshar is first confirmed child offender executed in the country this year.

His case only emerged today because of extensive research by Amnesty into child offenders on death row in Iran.

The charity also revealed that Iran may not have followed proper judicial process in their handling of his case.

Iran’s Supreme Court initially overturned the sentence due to incomplete investigations but ultimately upheld it in March.

The execution went ahead even though Iran’s Office of the Head of the Judiciary had promised his family they’d review the case on 15 September.

Amnesty International’s Middle East and North Africa deputy director, Magdalena Mughrabi said: ‘Iran has proved that its sickening enthusiasm for putting juveniles to death, in contravention of international law.

‘Hassan Afshar was a 17-year-old high school student when he was arrested.

‘He had no access to a lawyer and the judiciary rushed through the investigation and prosecution, convicting and sentencing him to death within two months of his arrest as though they could not execute him quickly enough.’