Iranian authorities hanged a man in public on Wednesday after he was found guilty of raping and murdering a seven-year-old girl in a case that has caused uproar in the Islamic Republic.

The 42-year-old man, Esmail Jafarzadeh, allegedly confessed to the brutal murder after the body of the girl, Atena Aslani, was found in the garage of his house. She disappeared on June 19 when she was separated from her father, a market vendor.

The case provoked the anger of Iranians on social media and Jafarzadeh was killed in front of a cheering crowd in a square in the northwestern town of Parsabad, Ardebil Province, according to AFP news agency.

Trending: Duck Penises Get Bigger When They Are Surrounded by Other Males

Prosecutor in Ardebil, Naser Atabati, said the execution took place in public “to restore citizens’ sense of security and relieve their troubled minds.” The public prosecutor in Parsabad, Abdollah Tabatabayi, also said the suspect confessed to another woman, that of a woman who disappeared two years ago and whose body has never been found.

The case became so high-profile in the country that Iranian President Hassan Rouhani even intervened, calling it “horrendous” and demanded that justice be handed to the perpetrator. Tried in late August, Jafarzadeh was quickly convicted by the Supreme Court on September 11.

Iran hanging More

Arash Khamooshi/ISNA

Don't miss: Trump Was Being Honest When He Said He'd 'Totally Destroy' North Korea, Nikki Haley Says

Executions have been on the rise in the Islamic Republic, which despite not providing official figures of the number carried out in the country has regularly found itself in the top five countries for executions in the world, according to rights groups.

In 2015, they rose to almost 1,000, according to United Nations Special Rapporteur for Human Rights in Iran Ahmed Shaheed. That figure was a two-fold increase on executions in Iran for 2010. Amnesty International said it was the highest number executed for almost two decades. In 1989, more than 1,500 people were executed.

Many of those executed are done so for drug-related offenses, but other crimes such as murder and rape are punishable by death. Iran has also executed people for homosexuality.

Human Rights Watch warned in January that there had been an “alarming trend” of rising executions across the Middle East. Kuwait hanged several people in January, including a member of the royal family, the first since 2013. Jordan ended an eight-year moratorium in December 2014, executing 11 people. Bahrain executed three people in January after ending a six-year moratorium.

More from Newsweek