Rioting inmates decapitated their rivals in brutal fighting between two gangs in a Brazilian jail that left 56 dead, while 144 prisoners escaped, officials said Monday.

The riot broke out Sunday afternoon and lasted through the night at a prison on the outskirts of Manaus, the capital of Amazonas state, state public security secretary Sergio Fontes said.

Bloodied and burned bodies were stacked in a concrete prison yard and piled in carts, an AFP photographer at the scene said.

Source: b'Police officials outside the prison | Source: AFP'

Fontes's department later lowered the death toll to 56 from an earlier count of 60.

The fighting ranks among the most deadly of numerous prison riots across Latin America in the past decade.

Fontes called it "the biggest massacre" ever committed at a prison in the state.

Outside, heavily armed police hunted for dozens of inmates who escaped through a series of tunnels discovered at the Anisio Jobim penitentiary complex.

Fontes's department later said that 112 prisoners escaped from that prison and another 72 from the nearby Antonio Trindade Penal Institute. Just 40 of the escapees were captured, it added.

Source: b'Many of the inmates were found decapitated | Source: AFP'

Police finally restored order at the prison on Monday morning, freeing 12 guards who had been taken hostage, Fontes said.

They found a horrific scene inside.

"Many (victims) were decapitated, and they all suffered a lot of violence," he told a news conference.

He said the gruesome scene appeared aimed at sending a message from the Family of the North (FDN), a powerful local gang, to rivals from the First Capital Command (PCC), one of Brazil's largest gangs.

Source: b'Many of the inmates were decapitated | Source: AFP'

The PCC's base is in Sao Paulo, some 2,700 kilometers (1,650 miles) to the southeast.

"During the negotiations (to end the riot), the prisoners had almost no demands," Fontes told local radio network Tiradentes.

"We think they had already done what they wanted: kill members of the rival organization."