For Pepco, Hurricane Irene was not only the most dangerous weather system to rip through Washington in some time. It also was a test of whether the beleaguered power company could claw its way out of the basement of public opinion by keeping the lights on and restoring them when they blinked out.

With additional workers already in town upgrading power lines, and stepped-up public relations efforts, Pepco’s reputation appeared to weather the storm without serious damage.

As the winds subsided on Sunday, the utility succeeded in restoring power within 24 hours to 140,000 of the 220,000 affected customers. Fewer homes served by Pepco in the District and Maryland suburbs lost power than did those served by neighboring power companies.

On the customer relations front, Pepco worked hard to communicate and manage expectations, making automated telephone calls to 640,000 customers before the storm to warn that outages were likely.

Despite all that, Pepco officials acknowledged that beyond a single storm, they have long-term work to do to rebuild goodwill.

“It was a test, but we have to leave it up to the customers to determine whether we’ve passed,” said Pepco spokesman Bob Hainey. “When you’re still running the race, you can’t say you’ve won. But so far, for the most part, it seems like people are saying we’re on the right track.”

Pepco expects to restore service to all customers by Thursday evening. As of 9:30 p.m. Monday, Pepco was reporting 33,887 outages, almost half of them in Prince George’s County. Dominion Virginia reported 448,115 outages, including 5,762 in Northern Virginia. And in the hard-hit Baltimore region, BGE was reporting 295,074 outages.

Experts said only time will tell whether Pepco actually has improved, or just caught a lucky break.

Many key statistics regarding power company performance will remain unavailable for weeks, as restoration work continues. Moreover, storm intensity varies among neighborhoods — even block to block — making immediate comparisons among power companies difficult.

Pepco and neighboring companies will be filing detailed reports with regulators in about three weeks, said Paula Carmody, who represents consumers as head of Maryland’s Office of People’s Counsel. That will allow a more careful analysis of the causes of outages and the aggressiveness of the companies’ response.

“You do have to be careful,” Carmody said. “We don’t know the root causes of these various outages yet. A bare comparison of the fact that BGE had more outages doesn’t, in and of itself, tell you anything.”

Meanwhile, in Virginia Beach, Virginia Gov. Robert F. McDonnell (R) on Monday expressed condolences to the families of four Virginians who died from storm-related causes and many more who incurred property damage.

The governor, flanked by members of Virginia’s congressional delegation, said the state would aggressively push the federal government for a major disaster declaration that would allow Virginia to receive federal funds to help pay for damage caused by the storm. President Obama has already issued an emergency declaration to help defray the costs of taking steps to protect against a natural disaster.

McDonnell said Virginia suffered its second-largest power outage in its history with 2.5 million people affected, or more than any other state on the Eastern Seaboard. As of midday Monday, McDonnell said Dominion Virginia had restored power to more than 500,000 customers of the 1.1 million customers affected.

On Monday, Pepco officials said they believed that the company’s attempts to harden its system in the months before the hurricane helped minimize the storm’s impact. But a hurricane “is not really a good test of system reliability,” said Sandra Mattavous-Frye, the people’s counsel for the District.

“The focus now will really be on outage response — the restoration time. And that we really won’t be able to assess until service is fully restored across the District, to know how well they did,” she said.

District officials said they remained concerned about apparent lapses Pepco suffered in providing accurate and timely information about repairs to customers. Mattavous-Frye said that had been a “historic challenge” that Pepco may not have yet overcome.

“We are still having consumers call us and say they can’t get through,” she said. “It’s still a major issue.”

Maryland Gov. Martin O’Malley (D) said at a news briefing Monday that he was pleased with the state’s overall response to the storm, but that much work remained.

“I think none of us are satisfied and won’t be satisfied until everybody gets turned back on,” he said during his briefing at the Maryland State Operations Center in Reistertown.

O’Malley said he had talked with Montgomery County Executive Isiah Leggett (D) and that “he and I were both very, very impressed with the speed with which Pepco has been able to restore power in Montgomery County and actually throughout their service area.”

Hainey, the Pepco spokesman, declined to say whether the company had passed the storm’s test, because work was continuing. He added, however, that the company had “heard some encouraging words from people here and there. Some people have said, ‘Good job.’ ”

That was not the sentiment in the 5800 block of Chevy Chase Parkway in Upper Northwest, where a live wire smoldered and occasionally ignited branches on a large tree standing less than 20 feet from a home.

Frank Herrmann said he and his neighbors waited for a Pepco crew for 14 hours. “I was surprised they didn’t react faster to a dangerous situation,” he said.

Pepco, which suffered in recent years from plummeting customer satisfaction ratings, seemed to have a full press on managing expectations in advance of Irene. Even before the winds picked up, the 640,000 robo-calls to customers warned that outages were likely and advised them to stockpile food and medicine and battery-operated radios and alternative lighting sources.

Pepco officials held a news conference Friday, at which Joe Rigby, chief executive officer of Pepco’s parent company, Pepco Holdings, said 150 workers had been summoned from other states to assist 815 Pepco employees and a pool of contractors who have been in the region for months helping with repairs and tree trimming. By Sunday, Riggs said he expected to have 1,300 people in the field working on hurricane response.

Pepco also tackled public opinion in other ways, including a social media blitz. Company representatives spent the weekend responding to customers who were tweeting their frustration with the company.

“Neighbors are being told THURSDAY NIGHT for restoration of power? That cannot be true, is it? Almost a week? Please reply,” one customer tweeted. “What do I do about getting reimbursed for the $200 of perishables in my fridge/coolers that have gone bad?”

A Pepco representative responded: “That would be a question for claims. They can be reached at: 202-872-2452.”

Despite the prompt response, another Pepco customer jumped into the conversation, showing how far Pepco has to go to improve its image with some: “And the answer will probably be derisive laughter . . .” the customer wrote.

Maryland state Del. Tom Hucker (D-Montgomery) said that Pepco seemed to have “moved from an F to a D.”

“They showed slight signs of improvement, but my constituents are still very angry,” Hucker said. “There are a lot of neighborhoods still without power.”

Pepco’s public image problems peaked in December, when an investigation by The Washington Post concluded that Pepco’s reliability record was among the worst in the nation. The company ranked at or near the bottom nationally among electricity companies in terms of keeping the power on and bringing the lights back once the electricity goes out.

The Post found that the average Pepco customer experienced 70 percent more outages than customers of other big-city utilities. And the lights stayed out, on average, more than twice as long. Pepco’s reliability began faltering five years ago and company officials failed to stem the decline, the newspaper’s analysis found. Reliability in Maryland was substantially worse than in the District, where many lines are underground.

The report was followed by a torrent of public outrage and official response.

Maryland legislators passed a bill in April that imposes a $25,000-a-day fine on electric utilities for each violation of reliability standards. The standards are to be enforced by July 2013. Independently, the Maryland Public Service Commission is finalizing new performance standards for electrical companies statewide.

In July, District regulators tightened performance standards for Pepco, threatening to fine the company unless it improves reliability within two years and matches the performance of the nation’s most dependable power providers within a decade.

Staff writers John Wagner, Fredrick Kunkle and Brian Rosenthal contributed to this report.