A massive power outage on Thursday left millions of people in the dark in Southern California, Arizona and Mexico.

All of San Diego Gas & Electric Co.'s 1.4 million home and business customers lost power. The utility company is the main energy supplier for San Diego County and southern Orange County. Power was lost as far east as Yuma, Ariz., and the blackout hit Mexico's Baja California, cutting off power to more than 2.5 million people.

After midnight Pacific Time, lights gradually began coming back on, and by 3:30 a.m. Friday almost all of the effected areas in California and Arizona were up and running.

As of 5:30 a.m., three areas were still without power, effecting a maximum of about 2,000 San Diego Gas & Electric customers in Southern California. At last report, Mexico's Federal Electricity Commission was still working to return power to the cities of Mexicali, Ensenada and Rosarito.

The blackout appears to be related to a procedure an employee of APS, the largest electric utility company in Arizona, was  carrying out in the North Gila substation, just northeast of Yuma.

Operating and protection protocols typically would have isolated the resulting outage to the Yuma area, the company said in a statement. The reason that did not occur in this case will be the focal point of the investigation into the event, which already is under way.

When the power line tripped around 3:30 p.m., it triggered a chain reaction that eventually cut generators at the San Onofre Nuclear Station in San Diego County. Officials said that there was no risk of danger from the closing of the plant.

Although it backed up traffic for hours in San Diego, the blackout didn't stop people from having fun. According to the Los Angeles Times, students and revelers flocked to local bars, where drinks were poured and where taps still flowed.

San Diego International Airport is still experiencing the effects of the blackout, and a number of Friday flights have already been canceled.

“Airport still experiencing power outage. No passenger processing/outbound flights. Avoid coming to airport. Call your airline for updates,” the airport said in a statement.