SÃO PAULO, Brazil — Gunmen attacked a prison in northern Brazil while trying to enable a mass escape of inmates on Tuesday, setting off a gun battle with the police that killed 20 people and injured at least four, authorities said.

Public security officials in Para State identified 19 of the dead as prisoners or their supporters. A guard at the prison, the Santa Izabel Penitentiary, also died.

Officials were doing a head count inside the prison Tuesday night to determine whether any inmates escaped.

In a statement, police investigator Rodrigo Leao said two assault weapons, three pistols and two other guns were seized from a group that tried to get into the prison to enable a breakout by inmates.