The latest fighting at the prison in Guayaquil, Guayas province, has also left 25 people injured and follows a smaller armed clash earlier this month in which three inmates were shot dead.
There were reports of further violence at the prison later on Saturday and soldiers were deployed as reinforcements, securing the outside of the facility in armoured vehicles.
Family and friends of prisoners desperate for information gathered outside the building, where a list of victims’ names was taped to a post.
Authorities said the violence started as a territorial dispute between rival groups after a gang leader was released early.
“As this section of the prison was without a ringleader, other gangs tried to… enter to carry out a total massacre,” the governor of Guayas province, Pablo Arosemena, told reporters.
He said there were about 700 prisoners in the area of the facility where the deadly riot was taking place.
In a short statement posted to Twitter, President Guillermo Lasso offered his condolences “to the families who have lost loved ones” and said new measures were needed to “fight the mafias that profit from chaos”.
Earlier this month in a BBC interview, Mr Lasso insisted that his government was regaining control not only of the prisons but also of areas of Ecuador where drug traffickers had gained a foothold.
He accused previous governments of being “passive” about drug trafficking but warned that rising drug use in the country would take “more than a decade” to tackle.
And he said Ecuador would need international support from neighbouring Colombia, the US and the EU to strengthen its armed forces and police to combat the growing influence of crime gangs.
Ecuador’s prisons are currently accommodating about 9,000 more prisoners than they were designed to hold, officials say. The Litoral Penitentiary was designed for 5,300 inmates but currently holds 8,500.