Power has been restored to all 26,831 Xcel Energy electrical customers in Aurora and Denver after a raccoon managed to defeat security at a substation, blow out a transformer and cut off power early Friday morning, officials say.

The raccoon was electrocuted.

“We had a raccoon get into a substation and onto a large piece of equipment,” said Michelle Aguayo, Xcel Energy spokeswoman.

The incident happened at 3:55 a.m. Street lights from Yosemite to Sable streets and from Colfax to Alameda avenues were affected, according to an Aurora police tweet. Most of the outages are in Aurora, but some Denver customers on the East side also are without electricity.

Although power was cut to two hospitals, backup systems restored power and there were no major problems, Aguayo said.

Emergency crew members focused on getting power back for homeowners, but it was a slow process, because it must be done in stages or it could overcharge the system and lead to more outages, she said.