The violence broke out at El Inca prison north of the capital, Quito, shortly after the government said it was moving two inmates it suspected of being the masterminds behind previous prison disturbances to a maximum security prison.
Police commander Victor Herrera told reporters the prison had been secured, with heavy security deployed as forensics personnel removed the bodies of those killed. Herrera said the cause of death "appeared to be strangulation."
One of the two prisoners whose relocation sparked the violence, Los Lobos gang leader Jonathan Bermudez, had been responsible for a previous massacre at El Inca, according to a statement from the president's office.
"We told them that our hand would not tremble," President Guillermo Lasso said of the transfer on Twitter on Friday, warning of "the same fate for those who continue with their attempts to break the peace of Ecuadorans."
In other tweets, the president posted photographs of inmates with their hands tied and others lying face-down in prison courtyards and corridors.
The SNAI prison authority said that "members of this criminal organization (Los Lobos) undertook violent reprisals" for the relocation of Bermudez to another prison.
RHM/PR