SAN JUAN, Puerto Rico — Puerto Rico's Electric Power Authority says electricity has been restored to all 840,000 customers affected by a large power outage in the U.S. territory.

Executive sub-director Justo Gonzalez said Friday that crews worked up to eight hours to fix two lines that failed on Thursday. One of the lines was affected by a tree that fell during unrelated power restoration efforts elsewhere on the island.

Gonzalez said the company is using thermal vision equipment to detect and quickly address any potential failures on main power lines. Power outages across the island remain common nearly seven months after Hurricane Maria.

More than 44,000 customers overall remain without power since the Category 4 storm hit on Sept. 20.