More than 100 inmates have escaped from a maximum security prison in Brazil after heavily-armed men blew down the front gate of the facility in the northeast of the country.

Officials said the assault was carried out by about 20 armed men in four vehicles, who fired on watchtowers and used explosives to destroy the front gate of the Romeu Goncalves Abrantes prison.

The facility, which has 680 inmates, is located in Joao Pessoa, the capital of Paraiba state.

The state's secretariat for prisons said: "Heavily armed men knocked down the main gate after an exchange of fire with police and penitentiary agents."

41 of the 105 escaped prisoners have been recaptured so far as security forces locked down the state capital, closing schools and medical centres as a precaution.

Brazil has the world's third largest prison population, with 726,712 inmates as of June 2016, according to official statistics.

The population is double the capacity of the nation's prisons, which in 2016 was estimated to be 368,049 inmates.

Along with severe overcrowding, Brazil's prisons are plagued by gang violence.