BRASILIA (Reuters) - The 30 severed heads left by a gang war at a Brazilian prison this month were inspired by the tactics of Mexican cartels and represent a sea change in the country’s drug violence, a senior security official believes.

Slideshow ( 4 images )

Videos showed machete-wielding members of the North Family gang tossing the heads of rivals onto the blood-soaked yard of the Compaj prison in the state of Amazonas during the violence on Jan. 1. Even Brazilians, used to some of the world’s highest crime rates, were shocked by the brutality. The incident sparked a spate of gang-related prison massacres that have killed at least 130 people this month.

Amazonas State Security Secretary Sergio Fontes, a former federal police chief with 20 years of experience on Brazil’s northern frontier, said drug gangs were following in the steps of Mexican cartels that publicize their bloody executions on the Internet.

“When it comes to cutting heads the Mexicans started well before our gangs adopted that strategy of mixing terror with crime,” said Fontes in a telephone interview. “Our violence is imitating theirs.”

More than half of the 56 inmates slaughtered by the North Family, Brazil’s third-largest criminal group, in the Compaj massacre were decapitated.

A few days after the killing, a favela dance song praising the beheading circulated on social media, reminiscent of Mexican folk songs that recount tales of drug dealers and their exploits known as “narcocorridos.”

Brazil’s overcrowded prisons are now the battleground in a rapidly escalating war between the nation’s two biggest drug gangs, the Sao Paulo-based First Capital Command (PCC) and the Red Command from Rio de Janeiro, which has allied itself with the North Family.

In the early 2000s, Mexico’s once-dominant Sinaloa cartel began to publicize its violence, previously done in secret, with YouTube videos of masked hitmen torturing and decapitating rivals with machetes.

In Amazonas, the prison carnage, described by a judge who witnessed the riot as a “Dantesque scene”, sparked a wave of gruesome killings across penitentiaries in the north.

Crime researchers in Brazil say beheadings are not new in prisons, but have never been seen on this scale.

“The magnitude of the violence clearly reflects the worsening of this turf war between drug gangs,” said Victor Neiva, a researcher with the Federal University of Minas Gerais.

There is no evidence of commercial links between Mexican cartels, which smuggle cocaine into the United States, and Brazilian gangs that sell domestically as well as ship drugs to Europe.

Still, Fontes said authorities need to act now to stop local drug gangs from growing in size and power and dominating swathes of territory, as they have in Mexico.

“That risk certainly exists if we don’t pay attention to the signs. As we didn’t before these killings,” he said.