An Egyptian court sentenced seven men to life in prison on Wednesday for sexual assaults on women during public rallies in Cairo’s iconic Tahrir Square, in the first such heavy sentences since the government vowed to crack down on rampant sexual violence.

Sexual harassment has long been a problem in Egypt, but assaults have become more frequent and brutal over the past three years of turmoil, with frenzied mobs targeting women who take part in political gatherings.

The charges stemmed from four different incidents of sexual assault this year and last year, including one during celebrations of the inauguration of President Abdel-Fattah el-Sissi in June.

Videos of the brutal attacks posted online caused a public outcry, and pushed the new leader to make the highest profile condemnation of the escalating phenomenon and order a crackdown on perpetrators. A week later, 13 suspects were sent to trial in a speedy referral aimed to send a message of deterrence.

The various charges against the defendants ranged from attempted rape, kidnapping and assault to torture and attempted murder. The maximum sentence was life in prison.

In a nationally televised session Wednesday, the judge sentenced the seven men to life in prison. Three of them received multiple life sentences for taking part in different assaults. Another two men each received two 20-year sentences.

The men were to be placed on surveillance for five years once they finish their sentences. They were also ordered to pay financial compensation.

In one of his last decisions before stepping down in June, Adly Mansour, Egypt’s interim president and el-Sissi’s predecessor, decreed sexual harassment a crime punishable by up to five years in prison. The decree amended the country’s existing laws, which did not criminalize sexual harassment.

Harassers face between six months to five years in prison, with harsher sentences reserved for offenders holding a position of power over their victims, such as being a woman’s superior at work or being armed.

Copyright 2014 The Associated Press