A state of emergency and curfews have been declared in two Ecuador provinces after a series of attacks that killed five police officers.
President Guillermo Lasso said the attacks by increasingly powerful drug gangs were a declaration of war.
They had threatened to retaliate after the government introduced tougher measures to curb their power inside prisons.
More than 400 people have died in gang violence in prisons since 2020.
Officials said nine separate attacks were launched in the coastal provinces of Guayas and Esmeraldas on Tuesday, apparently in response to transfers of prisoners from overcrowded and violent jails.
Six explosions were reported in the western city of Guayaquil, police said, while two police officers were killed in an attack on a patrol car in the suburbs.
Three others were shot dead in the city and nearby later in the day, they added.
Three blasts were reported in Esmeraldas province, where seven prison officers were taken hostage by inmates. They were later released after negotiations, officials said.
President Lasso introduced the emergency measures in the two states for 45 days, restricting freedom of assembly and movement. Similar measures were taken in several provinces last year and in April this year.
Violence in Ecuador has grown sharply in recent years, including decapitations and prison riots, similar to scenes previously associated with Mexico.
It is thought this is because Mexican cartels have been recruiting local gangs to smuggle cocaine.
The latest violence come nearly a month after clashes between prisoners in one of Ecuador’s largest jails – in Latacunga – left at least 15 inmates dead.
The national prisons agency Snai said prisoners had fought with guns and knives, before guards managed to regain control of the facility just south of the capital Quito.
The turf wars between gangs fighting for control of lucrative cocaine networks have put huge strain on the under-resourced and overcrowded prison system.
The worst prison clash was in the port city of Guayaquil in September last year, when more than 120 inmates died.
Last year Ecuador’s police seized a record 190 tonnes of drugs, mostly cocaine.
You may be interested in watching: