RIO DE JANEIRO (Reuters) - Brazilian police used rubber bullets and tear gas on Tuesday to break up a renewed clash between drug gangs in a prison where 26 inmates were butchered by rivals in recent days.

Major Eduardo Franco, spokesman for police in the state of Rio Grande do Norte where the Alcaçuz prison is located, said authorities managed to keep the rival gangs apart and so far prevent another massacre.

Brazil has been hit by a wave of deadly gang clashes in prisons in the north and northeast regions of the country since Jan. 1. At least 140 inmates have been killed in the intense violence.

President Michel Temer’s office said the federal government decided on Tuesday to allow Army troops to reinforce security at state prisons if governors made requests. As of late Tuesday afternoon, no governors had requested such help.

The soldiers would be limited to inspecting the prisons and confiscating weapons, drugs and other contraband, along with searching visitors entering the facilities. They would avoid any sort of longer-term occupation of penitentiaries.

Security officials said members of Brazil’s most powerful drug gang, the First Capital Command (PCC), who last Saturday started a riot in Alcaçuz and murdered 26 members of a rival gang, many of whom they beheaded, tried to invade their enemies’ prison wing again early Tuesday afternoon.

Images broadcast live on Globo TV showed prisoners from both the PCC and the local gang “Crime Union of RN” - RN being the Portuguese initials for Rio Grande do Norte state - atop the roofs of their respective wings, waving banners with gang insignia and wielding knives, clubs and other homemade weapons.

Slideshow ( 5 images )

Scores of prisoners were seen running free within the prison - clearly indicating that security officials did not have control of the prison, which Franco said they had regained on Monday night.

On Jan. 1, the powerful North Family gang, which largely controls a lucrative cocaine drug route along the Solimoes River in the Amazon that flows into Colombia and Peru, the world’s top two cocaine-producing nations, killed 56 inmates at a prison in Amazonas state, mostly PCC members.

The PCC retaliated on Jan. 6 by killing 33 inmates at the Monte Cristo prison in the Amazonian state of Roraima, before carrying out the most recent killings this past weekend.

The clashes are the result of a split between the PCC and Brazil’s second-most powerful gang, the Rio de Janeiro-based Red Command.

For more than 20 years the two gangs maintained an uneasy working relationship, ensuring that a steady flow of drugs and arms easily made its way over Brazil’s porous borders with cocaine and marijuana-producing nations.

But about six months ago, security officials and experts say, the PCC moved to assume full control over trafficking routes and tried to push the Red Command aside.

Slideshow ( 5 images )

The Red Command responded by forming alliances with smaller regional gangs - including the North Family and Crime Union of RN.

Brazil’s 1,400 prisons - badly overcrowded and for decades the source of sharp criticism for medieval conditions and human rights abuses - are largely under the control of state governments, which seem unable to stop the gang war.

Authorities have started transferring the leaders of the uprisings to undisclosed prisons where they are placed in isolation.

But in the past this has proved ineffective and also stoked gang anger, prompting the PCC in particular to take the violence outside the prisons and onto the streets of major cities.

President Temer told Reuters in a Monday interview that the government plans to build 30 prisons, hopefully within one year, to ease the severe crowding in Brazil’s penitentiaries.