A leading activist in Egypt has been sentenced to 15 years in prison for attending a protest.

Alaa Abdel Fattah, 33, became a symbol of the 2011 uprising against president Hosni Mubarak through his role in the protests and on social media.

Late last year he was arrested at a protest, and charged under new laws banning demonstrations.

Released on bail, he arrived to attend his trial today, but before even reaching the courtroom he was sentenced in absentia to 15 years in prison, along with more than 20 others.

Police then reportedly arrested the 33-year-old activist outside the courtroom.

His lawyers are seeking a retrial, but the harsh ruling has been condemned by the blogger's family and supporters.

His sister Mona Seif wrote on her Facebook page that authorities had stopped the defendants attending the trial, which in this case under Egyptian law meant that they be given the maximum possible sentence and retried if they surrendered themselves.

His father, lawyer Ahmed Seif el-Islam, who was also the head of his legal team, called the proceedings a "trap" to arrest his son and other defendants and to force a re-trial with them in prison instead of free.

Activist Asmaa Mahfouz also expressed alarm over the prison sentences.

"Fifteen years for protesting? What about those who killed? Those who steal the money of the poor? Those who raped girls in the square?," she asked on Twitter.

"There will never be a state as long as this goes on."

The ruling came three days after former army chief Abdel Fattah al-Sisi was inaugurated as president, nearly a year after he toppled the country's first freely elected leader, Mohammed Morsi of the Muslim Brotherhood.

Since Mr Morsi's fall, security forces have killed hundreds of Brotherhood supporters. Rights groups say more than 16,000 people have also been arrested.

The protest law passed last year heightened fears about the future of political freedoms in Egypt.

The law, which rights groups say is deeply repressive, gives the Interior Ministry the right to ban any meeting of more than 10 people in a public place.

Western allies have voiced concerns about human rights abuses in Egypt but have not taken strong measures in protest.

"In today's verdict, the judiciary has shown that it regards the assembly law as a carte blanche to criminalise peaceful dissent," Human Rights Watch said in a statement.

"It's a further message that protest is not welcome in the new Egypt."

ABC/Reuters