Police in riot gear quashed an uprising at a juvenile detention center in Brazil that left 57 people injured, authorities said.

Forty-one prison officers and 16 inmates were treated for minor wounds after the 11-hour rebellion Wednesday at the Tatuape detention center in Sao Paulo, said Charles Roberto, a spokesman for the state government's Foundation for the Well-Being of Minors.

Three inmates and two guards remained hospitalized, but their injuries were not life-threatening, police said. Most of the rioters were between the ages of 15 and 17.

About 200 police officers in riot gear entered the detention center Wednesday morning and used pepper spray and rubber bullets to put down the rebellion, which involved nearly 500 inmates.

Authorities said the uprising likely began after a fight between rival gangs. Prison guards tried to intervene and 26 of them — including five women — were taken hostage.

Television images showed inmates on the building's roof holding iron bars and burning mattresses.