Authorities say five inmates have died in a prison riot in the central—western Brazilian state of Mato Grosso.

The state’s Security Department said in a statement that another 17 inmates were wounded in the violence yesterday at the Dr. Osvaldo Florentino Leite Ferreira prison.

Of the dead, four were shot and one had a heart attack.

Two guns were found inside the lockup.

The statement said the unrest apparently began as a fight between rival gangs. The uprising has ended, and authorities are negotiating to retake control of the area where the fighting occurred.

Brazil has seen a spate of prison riots this year that has left dozens of prisoners dead. The violence has raised serious questions about Brazil’s prisons, which are often overcrowded, understaffed and virtually controlled by gangs.