Bolivian Deputy Interior Minister Jose Luis Quiroga said the dead at the Palmasola prison were inmates "who resisted the police incursion."
Police said six police and 18 inmates were injured in the operation, which was launched to search the prison for weapons and drugs in the wake of a riot, presstv.ir reported.
About 2,300 police surged into the cell blocks before dawn, a week after an uprising triggered by a government order that bars children younger than six from visiting jailed relatives.
Wives and children live in the prison voluntarily with their inmate relatives. They were allowed to leave before the raid began, Quiroga said.
National police Chief Alfonso Mendoza said a search turned up "a still to make alcohol, and endless stands for sales of drugs, marijuana, cocaine."
"There was complete lawlessness in Palmasola," he said, even though police were meant to control the entry of people and goods into the prison.
The police separately revealed that they seized 85 knives, nine firearms, four grenades and 188 mobile phones, according to the newspaper La Razon.
Quiroga also attributed the uprising to a power struggle among inmates.
He said when police entered the prison, some inmates opened fire, wounding three police and triggering return fire.
The objective was to regain control over the prison because authorities had determined that inmates were using the prison to plot crimes in the city of Santa Cruz, he said.
"It was a successful operation — we have taken control," he said.
Inside the prison, the situation was relatively calm after the operation, but police used tear gas to disperse people who had gathered outside the prison wanting to know the fate of their relatives.
Located in eastern Bolivia, Palmasola houses an estimated 4,000 inmates and is reputed to be one of the most dangerous and overcrowded penitentiaries in the country.
It was the scene of an uprising in 2013 that left 15 dead.
Bolivian prisons have capacity for 3,730 inmates, but hold more than 15,000, according to official figures that date from December 2016.