The riot broke out Thursday morning in an exercise yard that serves the prison's newest arrivals.
A spokesperson said between 150 and 200 inmates were involved. Dozens were slashed and stabbed by fellow prisoners armed with homemade weapons.
Guards used pepper spray and fired off rifle rounds to restore order.
At least four prisoners were taken to the hospital with non-life-threatening injuries. No guards or staff members were hurt.
All 4,113 inmates at San Quentin, a maximum security prison that house's California's death row, have been confined to cells while officials investigate what led to the disturbance, an official said.
The Associated Press contributed to this report.