President Daniel Noboa has said the country is "in a state of war" against 22 gangs

Parts of Ecuador were facing power cuts of up to 13 hours on Thursday amid an electricity crisis sparked by a drought that has left key hydroelectric reservoirs nearly depleted.

A government decree ordering workers to stay home went largely ignored, with buses running as usual in the capital Quito, where traffic lights were out in some areas due to blackouts.

The electricity crisis comes days before a key referendum on Sunday, in which Ecuadorans will decide whether to greenlight tougher measures against organized crime in a country gripped by bloody gang wars.

Electricity provider Emelnorte detailed power cuts in northern Ecuador of up to 13 hours.

"Yesterday, they cut me off from eight to eleven (in the morning) and that is time that is needed to work. Today with eight hours (of blackouts) it is going to be worse," said Segundo Gaucho, 45, who owns a computer rental business in Quito.

According to Ecuador's Institute for Meteorology and Hydrology (INAMHI), aside from some areas in the north, much of the country has received below-average rain for this time of year.

Ecuador found itself in a similar drought-induced power crisis last year in October, when former president Guillermo Lasso struck a deal with Colombia to import electricity.

Faced with its own severe dry spell, Colombia this week halted the export of electricity to Ecuador.

Power cuts began on Sunday without warning and have progressively worsened.

Ecuador's President Daniel Noboa declared an emergency in the electricity sector on Tuesday, and replaced Energy Minister Andrea Arrobo, who the government said had been involved in a sabotage plot to hide the severity of the crisis.

Noboa has accused political rivals of targeting the electrical sector in a bid to impede the upcoming referendum on organized crime.

His government has filed a complaint with the prosecutor's office against 22 "saboteurs who sought to harm all Ecuadorians."

Quito ordered all workers to stay home on Thursday and Friday.

"A large part of the sacrifice that we Ecuadorians are making today and tomorrow and on Saturday is to ... guarantee that the elections take place because what is at stake in the consultation is national security" Roberto Izurieta, secretary of communication in the presidency, told the Teleamazonas channel.

Among the questions posed in Sunday's referendum will be whether to allow the military to be deployed to combat organized crime, and for increased penalties for those found guilty of drug crimes.

Izurieta said that alerts about the energy crisis "were not given in time" and the government considered this an "attack" by its political enemies ahead of the referendum.

Izurieta added that Ecuador has had "an energy policy for the last 20 years that has not adapted to the climate crises."

A government statement said the reservoir serving the country's Mazar hydroelectric dam stood completely empty, while the nearby Paute dam had storage levels of four percent.

Water at Ecuador's largest hydroelectric plant, Coca Codo Sinclair, is 40 percent lower than its historic average.