CHICAGO — A system-wide computer failure forced Southwest Airlines to ground its entire fleet of airplanes preparing for departures late Friday, and at least 57 flights had to be canceled even after service was fully restored hours later, a company spokeswoman said.

Michelle Agnew told The Associated Press that 43 of the cancellations were flights scheduled for late Friday night departures in the western half of the country. The other 14 were Saturday morning flights scattered across the U.S. because crews were not able to get to airports in time to make the scheduled takeoffs.

An estimated 250 flights — most of them on the West Coast — were grounded at least temporarily Friday night. The glitch impaired the airline's ability to do such things as conduct check-ins, print boarding passes and monitor the weight of each aircraft.

Some flights were on the taxiway and diverted back to the terminal after the problem was detected around 8 p.m. PDT Friday, Southwest spokesman Brad Hawkins said. Flights already in the air were unaffected.

Shortly after 11 p.m. PDT, Southwest posted on its Twitter page that "systems are operating and we will begin work to get customers where they need to be. Thanks for your patience tonight."

Agnew said the computer system was "running at full capacity" by early Saturday. Before that, though, officials used a backup system that was much more sluggish.

"Backup systems are in place, not the main system, so it's slower," Hawkins said after service resumed. "But we are able to start launching these flights."

He said cancellations were inevitable because the airline doesn't do redeye flights and by the time the problem was fixed, it was near "the end of our operational day."

The late hour of the disruption meant the computer problem affected far more flights on the West Coast, but Hawkins said at least a few on the East Coast were grounded as well. Southwest, based in Dallas, conducts, on average, 3,400 flights a day.

A spokesman for Los Angeles International Airport said of about 25 inbound and outbound flights remaining Friday, only five departing flights were experiencing delays, of 30 to 80 minutes. At LA/Ontario International Airport (ONT), a total of three flights — all departures — were affected.

Four Southwest flights were temporarily held in Seattle, said Christina Faine, a Seattle-Tacoma International Airport spokeswoman.

One flight to Oakland, Calif., had been due to leave at 9:20 p.m. and departed before 11 p.m. Faine said late Friday night that an airport duty manager, Anthony Barnes, told her the others were expected to depart shortly.

Steve Johnson, a spokesman for Portland, Ore., International Airport, said he was not aware of any planes held up there.