CAIRO - Egyptian courts have in a single day convicted 152 protesters for breaking a law that effectively bans demonstrations, sentencing them to up to five years in prison in a series of short mass trials.

The cases against the 152 convicted Saturday are rooted in events on April 25, when police stifled planned demonstrations called to protest the government's surrender to Saudi Arabia of two Red Sea islands under a deal negotiated in near total secrecy.

Police arrested more than 1,200 people during the run-up to April 25 and on the day, but released most of them without charge. However, nearly 300 were referred to trial for breaking the 2013 protest law decried by rights groups at home and abroad.

On Saturday, a Cairo court convicted and sentenced 51 people to prison for two years for their part in the protests.

Later that day, a judge presiding over two other trials of protesters convicted 101 defendants of breaking the same law and sentenced them to five years in prison, according to officials and defence lawyers.

They said 79 of them were fined $10,000 each and 72 of the 152 were tried in absentia.

The officials spoke on condition of anonymity because they were not authorized to speak to the media.

The verdict on the case of 51 protesters was announced after just two hearings, defence lawyer Sarah Rabee of the Al-Haqaniya rights group said.

She added that the judge evicted the press, denied families access to the defendants, and turned down a request by the defence to access footage from security cameras in downtown Cairo, which they said would show that there were no real demonstrations in the area that day.

In the case of the 101 defendants, the judge issued his verdict in the second hearing, according to defence lawyer Ahmed Othman. On Saturday, he heard the defence arguments for eight hours before he held a 15-minute recess and returned to the bench to announce the verdict, said Othman, who attended both hearings. The verdict was announced in a courtroom housed inside a police base on Cairo's outskirts.

It is not uncommon for Egyptian courts to convict large numbers of defendants in mass trials, or to use courtrooms located inside police bases. Hundreds of supporters of Egypt's former president, Mohammed Morsi, were sentenced to death or life imprisonment in a series of trials held in the nearly three years since the Islamist leader was ousted by the military, then led by Abdel-Fattah el-Sissi, the current president.

Scores of young pro-democracy activists have also been imprisoned since Morsi's ouster.

El-Sissi often speaks in defence of the judiciary, saying it is independent. Rights activists argue that the judiciary is beholden to the country's executive.

The deal over the islands has sparked mounting criticism of el-Sissi by activists and an array of politicians, with many asserting that it amounted to a sell-off to oil-rich Saudi Arabia in return for a multibillion dollar aid package to Egypt announced by the Saudis last month.

El-Sissi insists the islands belong to the Saudis and has angrily demanded an end to public criticism of the deal.

The Egyptian president has in recent weeks repeatedly stated that he has a duty to balance safeguarding human rights with the fight against a resilient insurgency by Islamic militants in the Sinai Peninsula and efforts to revive the economy.

His stance continues to enjoy the support of a majority of Egyptians, who are fatigued by five years of political and economic turmoil. However, the islands deal and a steep rise in prices, primarily food and utilities, are cutting into his popularity.