Rebellious inmates, who took over the New Mexico State Penitentiary in a riot that killed at least 18 prisoners early today, threatened to start executing guards and blacks tonight.

Prison officials said negotiations stalled when the Mexican-American leaders of the outbreak demanded more access to the media.

Penitentiary officials said they would give that access only if the inmates released some of the 12 hostages, all prison guards.

"You tell some of those people out there we're going to start killing some of the niggers," an unidentified inmate told officials. "They killed some of our brothers. We got 16 dead Mexicans, two dead whites and the rest are going to be niggers."

The inmates said they would also start killing hostages if their demands are not met, threatening to kill them one by one and throw them into the prison compound.

When the riot began early today, the prisoners took 15 prison employes hostage. Later, two were released because they were suffering from smoke inhalation. A third hostage, Lt. Joe Anaya, was released about 9:15 p.m., unconscious and seriously injured.

The population of the state prison is about 80 percent Hispanic, with the remaining 20 percent divided between white and black men. Racial problems have been prevalent throughout the New Mexico penal system for several years. h

Prisoners were reported in "absolute control" of the maximum security penitentiary by prison warden Jerry Griffin, whose administration has been plagued by escapes and problems between staff members and inmates.

Late reports, including one from an aide of Gov. Bruce King, indicated that some of the dead inmates had been mutilated. At least one had been hanged, and another was partially decapitated with a shovel, official sources said.

The leaders of the takeover allowed at least 26 injured inmates to leave the prison for treatment. Five were suffering from smoke inhalation, one had a serious head injury from a meat cleaver, another had an arm fracture and two had unspecified injuries.

Negotiations with the prisoners that began at mid-morning today were continuing. The negotiators are New Mexico corrections official Felix Rodriguez, deputy warden Robert Montoya and two New Mexico newscasters, radio-television commentator Ernie Mills and John Andrews of KGGM-TV in Albuquerque.

King talked with two inmates by telephone this morning, but has not entered the penitentiary.

State police and National Guardsmen ringed the penitentiary as smoke continued to billow from some buildings after inmates set fire to mattresses and other items.

King said the inmates' complaints included overcrowding, harassment by guards and tension within the institution. They have demanded that Montoya, the deputy warden, be relieved.

The penitentiary was built in 1954 for a capacity of 1,000, later reduced to 700. It now houses 1,140 inmates, of whom about 450 walked into the central compound early today and surrendered to police.

Today's uprising followed by less than two months an escape of 11 prisoners. An investigation by the New Mexico attorney general's office said it could not have occurred in a prison under proper supervision.

Of the 11, one, convicted double murderer William Smith, is still at large.

The escape led to the resignation of heavily criticized criminal justice secretary Charles Becknell, who some New Mexicans say was made a scapegoat because he is black.

Griffin, penitentiary warden since April 1979, survived the uproar. However, similarities exist between the prison conditions alleged to be behind today's uprising and problems Griffin had as director of the Roswell Correctional Center, a minimum security facility in southeastern New Mexico he ran from early 1978 until last April.

At the correctional center, Griffin also drew heavy fire for having lost control of his staff. Inmates there wanted Griffin's second in command, Adolph Barella, fired, and there were accusations that staff members were supplying inmates with drugs.

The New Mexico Corrections Division took no action on the accusations.

Becknell's replacement, newly appointed secretary of criminal justice Adolph Saenz, said today he plans to take a hard look at Griffin's performance.

Unaware of the prison revolt, Saenz was reached at his home in Alexandria, Va. The new appointee, who expects to assume control in New Mexico in early March, is currently assistant director for the U.S. Customs Patrol. He has 10 years of executive level experience in criminal justice and said he believes in "firm, forceful" penal administration.

Saenz, who faces a New Mexico Senate confirmation hearing late next week, said of the prison's administration that it appears "I will have to review the performance of the warden and take a good look at it."