LA PAZ, Bolivia — Police raided Bolivia’s notorious Palmasola prison early Wednesday in a hunt for weapons and other contraband, touching off a gunbattle with prisoners who control the jail. Seven inmates died and 25 people, including six officers, were wounded, authorities said.

Some 2,300 police officers participated in the operation and were supported by helicopters.

National police Col. Faustino Mendoza said officers seized arms, equipment to distill alcohol, marijuana plants and other drugs from the section that houses the most dangerous inmates.

“There was misrule in this prison,” Mendoza said.

Bolivia’s largest prison houses about 9,000 inmates outside Santa Cruz, about 335 miles (540 kilometres) east of the capital of La Paz. Inmates control the prison, where drugs are cheaper than on the street and money buys survival.

Six prisoners escaped from Palmasola last week during an inmate riot. Authorities say four have been recaptured.

In August 2013, during a struggle for control of the cellblock holding Palmasola’s most violent inmates, one group attacked rival prisoners with machetes and home-made flamethrowers. Thirty-six people died, including a 1-year-old who was there visiting his inmate father.