Egyptian security forces have detained and tortured hundreds of children in recent years, including electrocuting them on their tongues and genitals and making them stand on beds of nails, according to a new report.

An investigation by Human Rights Watch (HRW) and Belady, an Egyptian children's charity, found that children as young as 12 were being regularly swept up in raids by Egyptian authorities and abused while in detention.

One boy, named only as Hamza, was arrested in 2016 for taking part in a protest as a 14-year-old.

"During the first two days of his interrogation, officers used electric shocks on his genitals, head, and tongue. On the third day he was suspended by his arms, which dislocated both his shoulders," a relative said.

He spent his 15th birthday with nails placed under his heels, forcing him to stand painfully on the tips of his toes to keep his weight from coming down on the spikes, according to the report.

The teenager was not allowed access to a lawyer until six weeks after his arrest and he has since been sentenced to 10 years in prison. His family is allowed to visit once a week for five minutes, HRW said.