A power outage at the Second Avenue subway stations shut down train service on the Upper East Side Friday for several hours, the MTA said. 

The loss of power at the 72nd, 86th and 96th street stations first happened at about 10:35 a.m., the agency said. While it was restored shortly after, it went out again at about 11 a.m. and did not come back on until after 1 p.m., the MTA said.

As a result, there were no Q trains running between 57th Street-Seventh Avenue and 96th Street, and no W trains were stopping at 57th Street-Seventh Avenue until about 1:15 p.m., the MTA said. 

There were no N trains at 57th Street-Seventh Avenue for about 20 minutes before the second outage.

The MTA said to expect delays on N, Q, R, W and B trains, as regular service resumed. The cause of the power outage was under investigation, the agency said.