A power failure at Metro-North Railroad’s control center at Grand Central Terminal cut service to its three main lines on Thursday night, stranding thousands of passengers across the metropolitan region for nearly two hours and setting off a chaotic scene as the hub swelled with bemused commuters.

At around 7:45 p.m., according to the Metropolitan Transportation Authority, the power supply to the computer system that controls all Metro-North train movement was “interrupted,” prompting rail traffic controllers to order a full-scale shutdown in radio communications to train engineers. Trains were ordered to go to the nearest station, though not all were able to do so immediately.

Service began limping back to life on the Hudson, Harlem and New Haven lines around 9:30 p.m., after the railroad established a temporary power source. Marjorie Anders, a spokeswoman for the authority, predicted that the Friday morning rush would be unaffected.

But for those onboard the trains, the delays made for a hellish commute.

On one train, at rest on a bridge over the Harlem River, passengers packed the aisles and floor space, awaiting updates from the crew.