A juvenile detainee, centre, is on his knees while being arrested during a riot at the Frank Baxter Juvenile Justice Centre, at Kariong, Australia. Picture: Dean Lewins/AAP Image via AP

Sydney - Several inmates were stabbed during a riot at an Australian juvenile detention centre that ended after 21 hours with 20 arrests, police said Monday.

The riot at the detention centre north of Sydney started at 8.30 p.m. Sunday, Police Superintendent John Gralton said. Nine inmates surrendered by Monday afternoon but another 11 had not, he said.

Police later stormed the rooftop where the rioters were holding out and arrested them, a police statement said.

"With nightfall coming, due to safety risks for all involved, we decided it was time," Gralton told reporters.

The union representing the guards said inmates stole keys from an officer and took garden tools, including a hedge trimmer and shovels, from a maintenance shed. Public Service Association general secretary Stewart Little said the group targeted known sex offenders.

"It seems a very sudden and unprovoked incident," Police Superintendent Tony Joice said. "Identifying the means and reasons why the assaults have taken place is part of the investigation."

Gralton said five injured inmates were taken to hospitals and one was in intensive care.

A total of seven inmates were injured, with injuries including stab wounds, a dislocated ankle and a broken nose, officials said. Inmates who participated will be charged with rioting, an offense that carries a potential maximum of 15 years in prison.

The Frank Baxter Juvenile Justice Centre at Kariong has a capacity of 120 inmates. Police had quarantined the armed detainees in a building within the complex, Joice said, and all inmates have been accounted for.