The outage stemmed from a problem at Pepco’s Florida Avenue NW substation, a spokesman for the utility said. (John Kelly/The Washington Post)

About 39,000 Pepco customers lost power for several hours starting Saturday afternoon, an outage that affected a wide swath of Northwest Washington, including parts of the Shaw, Logan Circle, U Street, Dupont Circle, Woodley Park, Van Ness, Mount Pleasant and Adams Morgan neighborhoods.

Power was restored for all customers as of 2:48 a.m. Sunday, the utility said.

The outage began around 2:30 p.m. on an afternoon when temperatures in the city hovered around 90 degrees, silencing air conditioners and ceiling fans and setting off automatic fire alarms. Traffic lights went dark, and business halted along the commercial strips of U and 14th streets NW.

A Pepco spokesman said the outage stemmed from a problem at its Florida Avenue NW substation.

Electricity began surging back to several neighborhoods around 4 p.m., and all but 5,500 customers had their power restored by 9:30 p.m.

Vito Maggiolo, a spokesman for the D.C. fire department, said there were numerous calls from people stuck in elevators during the first part of the outage. No injuries were reported.

MedStar Washington Hospital Center, Howard University Hospital and Children’s National Hospital lost power and used emergency generators. Service on Metrorail was not affected, although one entrance to the U Street station was closed.

Most customers left Frugalista, a thrift store in Mount Pleasant, because the store couldn’t take credit card payments. “These days, nobody’s carrying cash,” manager Anna Cajina said.

The Lincoln Theater on U Street NW canceled a fundraising performance of Story District’s “Breaking Bread.”

The city’s Department of Parks and Recreation closed three centers affected by the blackout — Kennedy, Columbia Heights and Banneker, which has an outdoor pool. The locked gate at the azure Banneker pool upset some who came seeking relief.

An employee at the Trader Joe’s on 14th Street NW said power was out for an hour and a half. “We just thought it was going to be out for a second,” said the employee, who spoke on the condition of anonymity. “It lasted a lot longer.”

A few outages were scattered elsewhere in the region.

Martin Weil contributed to this report.