The officers were convicted of killing 13 inmates in the city's Carandiru jail during an operation to end a revolt.
In all, 111 prisoners died, and prosecutors argued that most of them were shot dead at close range.
The officers' lawyers said they would appeal. Three other policemen were acquitted during the trial.
The 23 convicted officers - most of whom are now retired - had originally been accused of killing 15 inmates, but two of the victims were later thought to have been killed by fellow prisoners.
Dozens more officers are expected to be brought to trial in connection with the case in the coming months.
In 2001, Col Ubiratan Guimaraes, who led the police operation to regain control in Carandiru, was convicted of using excessive force. But he was acquitted on appeal in 2006.
'Self-defence'
The riot began on 2 October 1992 after an argument between two inmates quickly spread, with rival gangs facing off in what was at the time one of South America's largest prisons, housing 10,000 inmates.
Inmates said riot police brutally repressed the riot.
"We never thought they would come in and kill people randomly, as not everyone had joined the rebellion," former prisoner Jacy de Oliveira told BBC Brasil's Luis Kawaguti.
"The policemen began shooting everyone; I was on the fifth floor, if you looked a policeman in the eyes, you were dead," he said.
The officers' lawyer, Ieda Ribeiro de Souza, argued they were only doing their duty and acted in self-defence, as many of the inmates were armed.
While prison riots are not uncommon in Brazil, the number of those killed at Carandiru and the slow pace of the Brazilian justice system in bringing the accused to trial has shocked the public.
Carandiru was closed in 2002, shortly after inmates co-ordinated simultaneous uprisings in 27 jails across Sao Paulo state during which thousands of visitors were held hostage.
A court in Brazil has sentenced 23 police officers each to 156 years in jail for involvement in  a notorious 1992 prison massacre in Sao Paulo.