RIO DE JANEIRO, July 29 (Xinhua) -- The death toll from a prison riot in Brazil's northern Para state Monday climbed to 57, authorities said.

The riot led to the deaths of 16 inmates, who were decapitated, and 41 who died of inhaling toxic smoke from burning mattresses, according to the state's Superintendency of the Penitentiary System (Susipe).

The riot, sparked by clashes between two rival gangs, broke out at the Altamira Regional Recovery Center at breakfast time, after members of one gang attacked two prison guards to access the wing where the rival gang members were housed.

"It was a swift attack in a way, aimed at wiping out the rival members," Para prison official Jarbas Vasconcelos said.

"They went in, started a fire, killed and ended the attack. It was a directed, localized attack," Vasconcelos added.

According to Susipe, the prison was built to hold 163 inmates, but was housing 343, more than twice its capacity.

The Brazilian government announced an immediate transfer of 46 inmates who took part in the riot.

In recent years, riots between rival gangs have become commonplace in the Brazilian prison system.

In May, 55 inmates were killed in a wave of gang-related violence at four prisons in the neighboring state of Amazonas, also Brazil's poorer northern region.