An uprising by 890 inmates at Sao Paulo's Pirajui penitentiary ended early Wednesday nearly 24 hours after it started, with one inmate decapitated and four injured, prison authorities said.

The prison riot, during which eight prison guards were taken hostages by the inmates, was brought under control by police one hour short of a deadline set by the Sao Paulo government for the inmates to return to their cells.

The riot followed a massive, simultaneous uprising Monday in 29 prisons across Sao Paulo involving 22,000 inmates that left 19 inmates dead when it was brought to an end.

But Tuesday's uprising was seen as a prelude to more trouble at Brazil's notoriously overcrowded penal institutions.

"This was not a massive rebellion, this was a rehearsal ... the massive rebellion is coming," said prison guard union president, Newton de Oliveira, insisting it was crucial to carry out prison reform.

Military police Wednesday morning took up positions inside Pirajui penitentiary and were conducting a cell-by-cell search for weapons and drugs, a prison spokesman said.

After the riot ended, police found one inmate decapitated and four others injured inside the penitentiary. The hostages had been released unharmed.

As with the multiple uprising on Monday, Tuesday's riot at Pirajui was carried out with support from the prison-based drug gang First Capital Commando, known by its Portuguese acronym PCC.

The PCC, which has been operating for about eight years, controls drug trafficking in state prisons, coercing inmates who do not join to pay fines, and killing those who betray it.

During the 15-hour prison uprising, authorities acceded to one demand made by the inmates, placing five PCC leaders together in the same cell, but rejected requests for a cell-phone and to transfer 12 inmates to the Carandiru penitentiary, the spokesman said.

The multiple uprising earlier this week -- the biggest in Brazil's history -- was coordinated from Carandiru, Latin America's largest prison.

Brazil's prison population has exploded to 196,000 nationwide, representing 0.12 percent of the nation's 170 million people. An average 2.5 people live in space designed for just one inmate.

The chronic overcrowding, particularly in Sao Paulo state prisons where half the Brazilian inmate population resides, leads to riots about once every 36 hours, according to the Roman Catholic church.

President Fernando Henrique Cardoso has said he would increase federal funding of the prison administration this year to 33 million dollars, from 4.5 million dollars last year.

He said his government also intended to propose alternative sentencing, improved rehabilitation programs and better training for prison guards.

The union, which represents 4,000 of the state's 23,000 prison employees, wants higher salaries, a 30-hour work week and better security equipment, such as metal detectors. They also want guards to be allowed to carry weapons -- SAO PAULO (AFP)