New York (CNN) Power was fully restored in New York early Sunday after an outage left parts of the city in darkness for hours, leaving thousands trapped in subway cars and elevators, and people guiding traffic at intersections.

The outage started Saturday evening and the lights were back on shortly after midnight, officials said. It mostly affected midtown Manhattan and parts of the Upper West Side. No injuries were reported.

People spilled out into the streets as lights suddenly dimmed at Broadway shows and speakers fell silent at Jennifer Lopez's concert. Even the flashing lights at the iconic Times Square went dark, leaving the area surrounded by the glow of cellphones taking photos of the surreal scene.

Lopez said she was disappointed she had to cancel her concert on her second night at Madison Square Garden. She rescheduled it for Monday night

"I'm devastated and heartbroken right now," she said. "I just don't even know what to say. ... Obviously it was beyond all our control."

When the lights flicked back on, crowds erupted into cheers in some places.

People walk along a dark street near Times Square.

Hours of darkness

At the height of the outage, 72,000 customers were in the dark, utility company Con Edison said. It had given a preliminary number of 73,000 -- but lowered it early Sunday. Power started trickling back on just before 10 p.m., it said. Gov. Andrew Cuomo asked people to stay indoors despite the full restoration.

"While power has been restored, there are still some traffic signals that are out, so we would not encourage New Yorkers to go out if you don't have to go out," he said.

Officials have released varying descriptions about what led to the outage. Mayor Bill de Blasio, who was returning to the city after a presidential campaign stop in Iowa, said the outage appeared to be the result of a mechanical problem.

"This appears to be something that just went wrong in the way that they transmit power from one part of the city to another," he said.

Cuomo told CNN there was a malfunction at an electrical substation, and that the malfunction temporarily knocked out other substations.

Con Edison described the problem as an "equipment failure" and said the cause of that failure will be investigated. CEO John McAvoy said his company divides the electric system into networks that are roughly equivalent to neighborhoods, and that Saturday's problem interrupted power to six networks.

"We expedited the recovery, performed an initial assessment of what was the most likely cause, isolated that equipment, inspected the other equipment to identify any obvious abnormalities," McAvoy said.

Cuomo described a power outage of this magnitude as unacceptable, and said he's called for a full investigation into the cause. He applauded residents for keeping their cool.

"This could have been much worse. When you're talking about a city like New York with a significant piece of the city, basically suffering a blackout, that could be a very chaotic situation. We saw the exact opposite, actually. We saw New Yorkers at their best."

The sun sets behind 42nd Street in Manhattan during the power outage.

Regular people directed traffic

Lake Escobosa, 23, spent nearly an hour directing traffic Saturday evening.

The Brooklyn dancer guided cars, ambulances and pedestrians through a busy, three-way intersection near Lincoln Center on Manhattan's Upper West Side.

"I know how tricky it is when it comes to that intersection and I just saw in my mind car accidents, people getting hit, people screaming," she said. "So I felt like I should have just tried."

On Columbus Avenue, outside Fordham University's campus, brightly lit food carts illuminated the pitch-black streets.

Photos: Parts of Manhattan in the dark after power outage Seen from the air, a large section of Manhattan's Upper West Side and Midtown neighborhoods stand coated in darkness on Saturday, July 13. Hide Caption 1 of 18 Photos: Parts of Manhattan in the dark after power outage Times Square's billboards are black as people fill the street. Hide Caption 2 of 18 Photos: Parts of Manhattan in the dark after power outage People use their phones as flashlights. Hide Caption 3 of 18 Photos: Parts of Manhattan in the dark after power outage Pedestrians looks at their cellphones in midtown Manhattan. Hide Caption 4 of 18 Photos: Parts of Manhattan in the dark after power outage Radio City Music Hall is dark during the blackout. Hide Caption 5 of 18 Photos: Parts of Manhattan in the dark after power outage An entrance to the C and E trains at the 50th Street Subway Station is dimly lit. Hide Caption 6 of 18 Photos: Parts of Manhattan in the dark after power outage People sit inside a bar during the power outage. Hide Caption 7 of 18 Photos: Parts of Manhattan in the dark after power outage Dark buildings along a dark street are seen near the Times Square area. Hide Caption 8 of 18 Photos: Parts of Manhattan in the dark after power outage Con Edison workers stand around a barricaded transformer cover. Hide Caption 9 of 18 Photos: Parts of Manhattan in the dark after power outage People are evacuated outside Row NYC hotel. Hide Caption 10 of 18 Photos: Parts of Manhattan in the dark after power outage A convenience shop is closed. Hide Caption 11 of 18 Photos: Parts of Manhattan in the dark after power outage A man directs traffic on 8th Avenue and West 58th Street. Hide Caption 12 of 18 Photos: Parts of Manhattan in the dark after power outage The Upper West Side of Manhattan is in the dark. The city's fire department was responding to numerous transformer fires, the first of which occurred in Manhattan on West 64th Street and West End Avenue, officials said. Hide Caption 13 of 18 Photos: Parts of Manhattan in the dark after power outage People walk along a dark street near Times Square. Hide Caption 14 of 18 Photos: Parts of Manhattan in the dark after power outage A police officer directs traffic in Times Square. Hide Caption 15 of 18 Photos: Parts of Manhattan in the dark after power outage A view of the Hell's Kitchen neighborhood shows buildings in darkness. Hide Caption 16 of 18 Photos: Parts of Manhattan in the dark after power outage A train sits out of service at Penn Station. Hide Caption 17 of 18 Photos: Parts of Manhattan in the dark after power outage Buildings near Columbus Circle are dark. Hide Caption 18 of 18

Others spill out onto the streets

The outage had a widespread effect on the New York subway system. The Metropolitan Transportation Authority warned people to stay away from underground stations and consider taking the bus.

The city's fire department responded to numerous transformer fires and rescued people trapped in elevators and subway cars.

Several Broadway and off-Broadway shows said they were canceling performances.

Cast members from Broadway musical "Come From Away" held an impromptu performance outside their darkened theater. So did some Carnegie Hall performers.

"After being trapped on the F for an hour because of the power outage, I emerged to see dark restaurants and traffic lights, civilians directing traffic and an evacuated Carnegie Hall concert happening in the street," Briallen Hopper tweeted.