RIO DE JANEIRO — Thirty-one inmates were slain Friday in northern Brazil, some with their hearts and intestines ripped out, during a prison killing spree led by the country’s largest gang, authorities said.

The bloodshed comes just days after 60 inmates were killed during rioting at two prisons in a neighboring state and it increases fears that violence could spread, including to the streets of major cities, as gangs vie for influence and territory both inside prisons and in slums where trafficking operations are often based.

It’s also becoming a flashpoint for the government of President Michel Temer, whose administration is already struggling with an economic crisis and mounting corruption allegations. Authorities of the state of Roraima, on the border with Venezuela, said they requested help from Brazil’s federal government more than once to deal with its prison crisis, but no support was sent.

“This is a national crisis,” said Uziel Castro, security secretary of the state where the latest massacre happened.

Castro said the slaying spree began around 2:30 a.m. Friday at the Agricultural Penitentiary of Monte Cristo in the town of Boa Vista. He said it was led by members of Sao Paulo-based First Command, Brazil’s biggest criminal organization.

He said First Command members did not attack members of a rival gang, but rather other prisoners, for motives that were not yet clear.

“There was no confrontation, this was a killing spree,” said Castro. “It was barbaric. Some were beheaded, others had their hearts or intestines ripped out.”

Castro said firearms were not involved, and none of the 1,500 inmates in the prison built for about 700 had escaped.

It wasn’t immediately clear whether there was a connection to the gruesome rioting earlier this week in the neighboring state of Amazonas, which officials blamed on a gang war between the First Command and Family of the North, which fight over control of prisons and drug routes in northern Brazil along the borders of Bolivia, Colombia, Venezuela, Peru and the Guianas.

Brazil’s justice secretary lowered the death to 31 later Friday after authorities said throughout the day that 33 had been killed.

A police statement said officers, including a heavily armed military-like riot squad, had been deployed to the prison.

Just as details about the latest disturbance were emerging, Justice Minister Alexandre de Moraes announced measures to curb the violence.

Moraes said federal police would be more integrated in state capitals and that special task forces would be created to more quickly process criminal charges, a measure aimed at reducing overcrowding. Moraes offered no deadlines for the initiatives but said they would “be realistic” given the recession in Latin America’s largest economy.

“The situation isn’t out of control,” said Moraes. “It’s (just) another difficult situation.”

The rioting Sunday and Monday in Amazonas included the country’s worst prison massacre since 1992, with half of the 56 slain at one institution beheaded and several others also dismembered. In another of the riots in the state, four prisoners died.

A total of 184 inmates escaped from Amazonas prisons in the disturbances. As of Thursday afternoon, only 65 had been recaptured.

“The federal government needs to prepare for a worst case scenario, and that means accelerating measures to keep the situation from getting worse,” said Col. Jose Vicente, a former national security adviser and risk consultant.

In October, a riot at the Agricultural Penitentiary of Monte Cristo, the same where disturbances were reported on Friday, left 10 dead. Authorities said that clash involved the First Command and Red Command, which has its base in Rio de Janeiro. On the same day, eight others were killed in a prison in the state of Rondonia, which borders Bolivia.

After that clash, Roraima state’s Castro asked the federal government for help with the prison, according to a letter obtained by The Associated Press.

Castro requested that the national guard be sent in to help because the moving of prisoners deemed leaders of the rebellion had led to threats of retaliation.

Asked about the request Friday, Moraes, the minister of justice, said that Roraima had requested policemen to help in patrolling Venezuelans that were entering Brazilian territory — though that is not what the letter itself stated. He acknowledged that no help had been sent.

Moraes cancelled his trip to Roraima after Castro said the state had repeatedly asked the federal government for help and was always denied. Brazil’s Justice Ministry did not offer any explanation on the decision.

“Criminals are trying to kill each other. What we need is the federal government help,” said Castro. “This is all over Brazil.”