ATLANTA — Hundreds of flights were canceled and long lines snaked throughout the world’s largest airport Monday as the nation’s air-travel system struggled to get back on schedule after a crippling power outage in Atlanta that struck just days before the Christmas travel rush.

A fire in an underground electrical facility brought the main Atlanta airport to a standstill Sunday, and it could be days before Delta Air Lines, which has its hub in Atlanta, can resume normal operations. The fire broke out next to equipment for a backup system, causing that to also fail.

Power was fully restored about midnight. During those hours in the dark, thousands of travelers waited on planes or in the terminals. Disabled people had to be carried down stairs and escalators in the chaos. Inbound flights were diverted to other cities and outgoing flights were halted.

One bit of good news: Delta has more spare planes and crews in Atlanta than anywhere else, said Robert Mann, an aviation consultant and former American Airlines executive.

Anthony Foxx, who served as U.S. transportation secretary under former President Barack Obama, blasted airport officials, saying the problem was “compounded by confusion and poor communication.”

Foxx said he was among the many travelers stuck for hours on a plane on the tarmac.

“Total and abject failure here at ATL Airport today,” he tweeted, adding that there was “no excuse for lack of workable redundant power source. NONE!”

Georgia Power apologized for the inconvenience and thanked people for their patience in a tweet Monday. All essential services were restored and an investigation was ongoing, the tweet said.

Delta customers flying to or from Atlanta were able to make a one-time change to travel plans without incurring a $200 change fee. The airline encouraged travelers not to pick up their bags Monday because of congestion at the airport.

Juan Rivera, 46, arrived in Atlanta on Sunday for a layover on his journey from Huntsville, Alabama, to Newark, New Jersey. He waited on the plane on the tarmac for more than two hours until passengers disembarked into a dark airport.

He returned to the airport Monday morning and was unable to get on a flight to Newark, so he is now scheduled to fly to Philadelphia on Monday evening. Despite the 10 hours ahead of him at the airport, he had a smile on his face.

“I come from Puerto Rico,” he said, noting that many there have been without power since Hurricane Maria pounded the island in late September. “This is nothing compared to what’s happening over there.”

When Delta flights were grounded last spring, it took the airline five days — and about 4,000 canceled flights — before it fully recovered.

Like Sunday’s outage, that April storm hit at a busy travel time when there were not many empty seats to accommodate customers from canceled flights. At the time, CEO Ed Bastian vowed that Delta would make “significant improvements” to its system for scheduling and tracking aircraft crews to recover more quickly from disruptions.

Delta canceled about 1,000 flights Sunday and another 400 Monday. American Airlines canceled 24 departures and an equal number of arrivals, spokesman Ross Feinstein said.

Some passengers complained about a lack of information from airport officials and little help from first responders to get the disabled and the elderly through the airport without the use of escalators and elevators.

“They had these elderly people, handicapped people lined up in wheelchairs,” stranded passenger Rutia Curry said. “The people were helpless. They can’t get down the stairs. It was just a nightmare.”

Sara Melillo and her husband, Greg Presto, were traveling from Kenya, where they live, to Pittsburgh to spend Christmas with his family when they were stuck on the tarmac for six hours. The couple had made stops in Nairobi and Amsterdam and landed shortly after the lights went out in Atlanta.

Melillo said the pilot did not have a lot of information for travelers but the plane had air conditioning and flight attendants offered water and juice a few times. She described the Delta terminal as “big chaos” with not enough customer service for the hundreds of people trying to find a flight to their next destination and a place to sleep for the night.

In an email, Melillo told The Associated Press that the couple was scheduled to leave for Pittsburgh around midday Monday. The Delta check-in process was organized and lines were moving, she wrote. Airport workers were handing out doughnuts and other breakfast foods.

At Southwest Airlines, about 70 Atlanta departures out of 120 scheduled for Sunday were canceled, an airline spokesman said in an email. United Airlines and JetBlue Airways were among carriers reporting delays or cancellations.

Hartsfield-Jackson, which serves 104 million passengers a year, is the world’s busiest airport, a distinction it has held since 1998.

The airport serves an average of 275,000 passengers daily, according to its website.

Nearly 2,500 planes arrive and depart each day.