Ecuador was plunged into a nationwide blackout on Wednesday afternoon, and the country’s public works minister blamed the emergency on a failure of a key transmission line.The minister, Roberto Luque, said in a statement on X that he had received a report from the national electricity operator, CENACE, about “a failure in the transmission line that caused a cascade disconnection, so there is no energy service nationwide.”He said the authorities were working to resolve the outage “as quickly as possible.” Within hours, power had begun to return to some parts of Quito, the capital.The South American country of 18 million people has been struggling with an energy crisis for several years. Failing infrastructure, a lack of maintenance and a dependence on imported energy have all contributed to rolling blackouts — though none have been as widespread as this one.Around 3:15 p.m. Wednesday, the majority of Ecuadoreans found themselves without power.Most of the country’s energy comes from neighboring Colombia, a nation that has struggled to generate enough power for its own domestic consumption.A $2.25 billion Chinese-built hydroelectric power plant, the Coca Codo Sinclair Dam, was supposed to help solve Ecuador’s problem. Located on the Coca River in the province of Napo, 62 miles east of Quito, it is the largest energy project in Ecuador.The project has instead become a major headache for the Ecuadorean authorities. There have been several construction errors leading to a legal dispute between Ecuadorean officials and the Chinese company.The country woke up to widespread blackouts back in April, which the Energy Ministry attributed to historically low water flows after an extended drought, rising temperatures and a lack of maintenance of the country’s electrical system.For weeks afterward, the ministry imposed daily power cuts that lasted several hours. President Daniel Noboa declared an energy emergency, ordered businesses and government offices to shut down for several days and demanded the resignation of the energy minister.The blackouts ceased in mid-May, and Mr. Luque, who also serves as the acting energy minister, said on June 7 that the risk of power outages had been mitigated. But that assurance was short-lived.On June 16, parts of Quito were again plunged into darkness. Three days later, a blackout struck the entire country.On Wednesday evening, the sound of cars honking and drivers shouting filled the streets of Quito and the port city of Guayaquil as traffic lights stopped working and vehicles overwhelmed the cities’ streets. The public transit systems and some water supply companies suspended services in both major cities.The mayor of Quito expressed surprise on X that the blackout had affected the city’s subway system, which uses an “isolated” power source.“The event must be very significant to have affected even the power in the Quito metro,” he wrote.Thalíe Ponce contributed reporting from Guayaquil, Ecuador.