Seven prisoners were killed and 25 people were wounded when more than 2,300 police officers raided Bolivia's notorious Palmasola prison.

Police were searching for weapons and other contraband on Wednesday during the raid on the facility that prisoners largely control, sparking a gun battle with the inmates.

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

"There was misrule in this prison," Mendoza said, who described the situation as "out of control" after officers entered the facility.

Six police officers were among the two dozen wounded in the firefight.

Bolivia's largest prison houses about 9,000 inmates outside Santa Cruz, 540km east of the capital of La Paz.

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 homemade flamethrowers. Thirty-six people died, including a one-year-old child who was there visiting his inmate father.

Cramped conditions and violence are commonplace across Latin American prisons.