Iran executed a gay teenager this year after he was of convicted of the rape of another boy as a juvenile, in the first confirmed execution of an offender under the age of 18 in the country, according to a global NGO.

Amnesty International revealed this week that Hassan Afshar, 19, was hanged in a prison in Markazi Province on July 18 after being convicted of "forced male to male anal intercourse" in early 2015. He was a 17-year-old high school student when he was arrested in late 2014, Magdalena Mughrabi, Deputy Middle East and North Africa Program Director at Amnesty International, said in a statement.

According to Amnesty International, the execution went ahead even though the Office of the Head of the Judiciary had promised his family they would review the case on Sept. 15.

"Iran has proved that its sickening enthusiasm for putting juveniles to death, in contravention of international law, knows no bounds," Mughrabi said in a statement. "[Hassan] 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."

Another youth who was under the age of 18 at the time of his alleged offense — Alireza Tajiki — was scheduled to be executed on Aug. 3, but Amnesty International said that due to public pressure, it was delayed.

Rape does not fall into the category of offenses for which the death penalty can be imposed under international law, according to Amnesty International.

Hassan Afshar had said after his arrest in December 2014 that the sexual acts between him and another teenage boy were consensual. In Iran, consensual male to male intercourse is criminalized, and had it been deemed consensual both Hassan Afshar and the other teenager who accused him would have been sentenced to death. Because he was convicted of rape, only Hassan Afshar received the death sentence.

There are a reported 160 individuals who remain on death row in Iranian prisons for crimes allegedly committed when they were under the age of 18.