Power outages struck much of Manhattan for five hours Saturday evening, plunging subway stations, Broadway theaters and skyscrapers in the heart of the Big Apple into darkness on the 42nd anniversary — nearly to the hour–of the 1977 blackout.

Officials said some 73,000 residents were without power at the height of the outage, which officials preliminarily blamed on an Upper West Side manhole fire affecting an underground transformer.

The power went out at around 7 p.m., a blackout originally confined to the 30 blocks west of Fifth Avenue between 72nd Street and 42nd Street.

Each of the city’s 77 precincts sent four cops into the blackout zone to maintain order, direct traffic and otherwise help residents, law enforcement sources said — although some pedestrians stepped in at first, serving as ad hoc traffic cops.

By 9 p.m., the blackout had spread south to 12th Street, and the NYPD asked drivers to avoid the entire 60-block area west of 5th Avenue.

It took another hour for power to slowly begin rolling back on.

Times Square began twinkling again at 10 p.m. By shortly before 11 p.m., the traffic lights at Columbus Circle were back up.

More than 80 percent of the power was back on by 11 p.m., City Council President Corey Johnson tweeted.

By midnight, only a few stray traffic signals remained out.

“I am happy to report that as of a few minutes ago, all six networks and all 73,000 customers have been restored, ConEd CEO John McAvoy told reporters at midnight.

“We’ll be continuing to work through the evening to reestablish full reliability of our system, and then most importantly to identify exactly what caused the disturbance,” he said.

At the blackout’s worst, traffic lights were dark up and down the avenues, and apartment residents found themselves momentarily trapped in their elevators.

Police responded to 60 stuck-elevator emergencies, law enforcement sources said. And EMS rushed to check the homes of 18 patients on life-sustaining machines — to ensure their backup power was working.

Times Square’s storied sky-scraping billboards blinked out.

“I’ve lived here for 20 years, I’ve never seen anything like it,” Harold Phillips, 40, of Jamaica, Queens, said as he gazed up at a darkened Radio City Music Hall.

Madison Square Garden fell dark in the midst of a Jennifer Lopez concert, and hundreds of audience members poured out into the street.

“The concert went well for 20 minutes, and then — bomb! — the lights went out,” said one disappointed concert-goer, who gave her name as Liz, from The Bronx.

“I hope she feels our pain and comes back to perform for her fans again.”

Tourists with rooms in Times Square’s towering hotels were temporarily grounded. “We’re on the 34th floor” with no elevator, said Shannon Grimes, 48, who was visiting the city from Florida. “We’re not climbing back to our room.”

The outage slowed or stopped subways throughout Manhattan, with ripple effects in other boroughs.

“Distruption is significant,” Mayor de Blasio tweeted at 8:22 from Iowa, where he was campaigning.

City officials were working with the NYPD, FDNY and other city agencies to respond to the emergency, he tweeted.

By 10 p.m., the mayor was still heading by car from Iowa to Chicago, where he planned to take the first plane back to New York, a spokeswoman told The Post.

“He is on his way back now,” said the spokeswoman, Freddi Goldstein.

Fire officials confirmed a transformer fire at 64th Street and West End Ave., but couldn’t immediately say if that was the source of the outage.

“#FDNY is on scene of a transformer fire at W 64th St and West End Ave.” the department tweeted at 5 p.m.

“Members are responding to reports of numerous stuck elevators that are occupied, but there are currently no patients reported,” the tweet said.

Subway users found themselves trapped on dark, hot platforms and non-moving trains.

Near the Fulton Street station, some straphangers made the dangerous decision to climb out of the train and into the tunnel to reach the platform, users of the “Pigeon Transit” app reported.

“The worst part is the uncertainty of not knowing,” straphanger Huldenil Velazquez, 50, said in a darkened and sweltering subway station in Rockefeller Center. “Not knowing when things will start up again.”

“There’s a power outage at the subway station on 59th, anyone else having this problem? #MTA,” tweeted user Elizabeth Brennan, along with a picture.

Straphangers said the 7th Avenue station, too, was pitch black.

Twitter user @SouthPawSweet posted a dramatic photograph of Times Square, which showed the lights that usually covered the Crossroads of the World Square had gone out.

Broadway show-goers were ushered, disappointed, out of darkened theaters.

“It’s our last night in New York and we’re disappointed we won’t be able to see the ‘Lion King.’ We were really looking forward to it,’’ said Sheryll Ellis of Virginia.

“We’re just taking it in stride,’’ said her pal Emily Miller, who also lives in Virginia.

But some were compensated with impromptu, outdoor concerts by similarly stranded cast members and orchestras, the cast of Waitress among them.

The cast of the Tony-winning musical “Hadestown” performed outside the Walter Kerr Theatre on West 48th Street.

Outside Carnegie Hall, the Millennial Choirs and Orchestras sang a capella.

Shortly after 9:30 p.m. on July 13, 1977, power went out throughout the city after a severe thunderstorm destroyed power lines critical for delivering electricity to the five boroughs. The power was gradually restored throughout the next day.

Additional reporting by Larry Celona, Julia Marsh, Olga Ginzburg, Dante Jean, Nick Fugallo, and Allie Griffin