The bloody rebellion at New Mexico's maximum security penitentiary ended this afternoon when insurgent prisoners released the last of their prison guard hostages. State officials counted at least 32 inmates dead, and observers said still more bodies -- as many as 60 althogether -- still might remain inside the burning wreckage of the prison.

New Mexico Gov. Bruce King, his voice nearly drowned out by helicopters overhead, announced at 2 p.m. the prisoners had let out the last of 12 guards seized in the early morning darkness Saturday. "We have the hostages," King said as he prepared to reenter the still-smoldering prison. "We worked it out jointly . . . I haven't discussed settlement. I just know we're moving in."

King had called police and 50 National Guard troops to the prison at 2:30 a.m. Saturday, after inmates reportedly smashed through the security glass in the prison's control center and overpowered guards. He said state police and National Guard troops reclaimed the prison today with weapons at the ready, but without firing. The insurgent prisoners emerged from the central compound, King said, and surrendered by lying down on the ground.

A reporter who witnessed the final negotiation said five leaders of the rebellion asked that to avoid retaliation they be transported to prisons outside New Meixco. Felix Rodriguez, a high-ranking state corrections official, promised that this would be done, the reporter said, and "within five minutes, they [the prisoners] gave up the two remaining guards." The guards were released unharmed, according to state police.

As ashen-faced New Mexico families stood waiting for news of inmate relatives, King said the extent of deaht and damage inside the prison was still undetermined.

By evening 32 prisoners had been conformed dead -- apparently either beaten to death or overcome by smoke inhalation from fires set inside the prison. At least 40 immates and guards were removed from the prison and taken to a nearby hospital before the surrender. Some of the prisoners reportedly were in comas from overdoses of drugs taken from the prison pharmacy.

The uprising was the nation's worst prison riot since September 1971, when 43 inmates and hostages were killed in a revolt at Attica state prison in western New York. But unlike Attica, where state police troopers stormed the yard with guns firing, there was no such assault here.

The violence aparently came from the inmates. Reports of savagery within the prison began to filter out by early Saturday, and although there was no official confirmation, several people who had been inside the prison said one body had been decapitated with a shovel, and that several others had been mutilated.

"Some of these guys' gaces are totally gone," said corrections officer Fred Herrera. "There's nothing to identify."

Asked whether he was taling about disfiguarment from fire or rumored multilation, he said, "It's from the prisoners."

There were reports the bodies had been stacked and set afire in the prison gymnasium, but deputy warden Robert Montoya said that was unconfirmed. pState Criminal Justice Secretary Adolph Saenz said the death toll of 32 did not count any bodies that might be in the gymnasium.

It was a riot sparked by mounting bitterness at the overcrowded prison, according to attorneys and family members waiting outside. For several years, and especially in the time following an 11-man prison break two months ago, some prisoners had complained of harassment and poor conditions at the jail.

But once the riot was under way -- once the supposedly shatterproof glass had been broken and furious prisoners stormed their way into control of the facility -- the pent-up hatred of long-incarcerated prisoners apparently burst through.

One convict, 21-year-old Robert Mosely, told United Press International of being forced from his cell by the rioters, of being blindfolded and bound and then sexually assaulted.

"They [the rioters] picked on us because of our age and physical build," he said. "I'm in shock. When this thing started, people just turned into animals."

The rioting prisoners reportedly went after blacks, in a prison dominated by Hispanics. And reports received today indicated taht special fury was being vented at "snitches" -- prisoners who, according to prison files that were ransacked during the riot, provided information about other prisoners to authorities.

As National Guardsmen and police ringed the prison, its concrete walls blackened by fires set by rioters, early estimates of the damage reached $10 million.

"The educational unit is destroyed, the psychology unit is gone, the kitchen is gone, the administration section, the records area and the control center are all gone," said corrections commission chairman Steven Richards. He added that the prisoners proobably had burned most of the prison's 1,200 mattresses.

After King spoke by telephone on Saturday to one of the leaders of the revolt, an inmate who dientified himself as "Chopper one," the governor's staff released a list of 11 demands presented them by the insurgents.The demands, spurred by years of bitterness at the overcrowded 23-year-old maximum security facility, included these:

An end to overcrowding at the facility. Originally built for 700 to 800 prisoners, the New Mexico penitentiary now holds 1,136 men and women. State officials responded to this demand by saying that another 288 beds would be ready by July, and that they had asked the state legislature for an additional 200.

An improvement in prison food. Officials said a nutritionist would be hired to oversee the food operation.

An improvement in visiting conditions and an end to what prisoners call "overall harassment." Officials said they were examining possible solutions to both problems.

An improvement in educational facilities at the prison. Officials said the state legislature was looking into this, as well as a possible salary increase for inmates, who are now paid 25 cents per hour for their work.

As the rebellion raged inside the prison walls, fires in several of the compounds sent pale smoke high over the winter brown mesa. And hundreds of men began escaping from the occupied inside compound to the relative safety of the outdoor recreational area.

There, warmed by blankers that were dropped from helicopters during the night, they surrendered to police and waited for the revolt to subside.

An incomplete list of their names was released to press and the waiting families early his afternoon, and a mustachioed man knelt on a parked car to read for the frightened onlookers the names of men who had reached safety.

"Charles Whitlock, Alolfo Lemos, Albert Garcia, Anselmo Duran," droned the man's voice, punchtuated at intervals by the whine of ambulance sirens. A woman in the crowd, a white scarf over her head, looked up quickly as one of the names was read off.

"There he is, there he is, thank you Lord, thank you Jesus, thank you Jesus," she whispered over and over, her hands clasped.