In the days before Hurricane Irene bore down on the Washington region, Maryland Gov. Martin O’Malley was a constant presence on local TV, warning residents to take the “deadly” storm seriously. He hunkered down overnight in the state’s emergency operations center as it hit. And in the days since, he has publicly pressured utilities to get power back on and comforted homeowners who have trees through their roofs.

Virginia Gov. Robert F. McDonnell has appeared on more than a dozen national TV shows, taken aerial and walking tours of the most devastated areas, and held conference calls to coordinate with legislators and local leaders. He worked 16-hour days at his state’s emergency operations center before heading home to check on his family.

Irene has, no doubt, posed challenges for many residents of the region who have waited days to have their power restored and face daunting home repairs. But for the governors of Maryland and Virginia, it has offered national attention and a chance to display leadership in a time of crisis.

O’Malley (D) and McDonnell (R) — rising stars in their respective parties — fielded calls from President Obama and other federal officials and appeared the morning after the storm on NBC’s “Meet the Press.” Days later, they were on WTOP radio to assure residents of the Washington region that the states were doing all they could to restore power, clear roads and return life to normal.

In such situations, politicians can risk looking too interested in self-promotion. But O’Malley and McDonnell — who aides said texted each other the night Irene arrived — have received high marks for their measured leadership, even from some frequent critics.

“People want to know that their elected officials understand what they’re going through, and the only way you do that is to go out and be there,” said Maryland House Minority Leader Anthony J. O’Donnell (R-Calvert), who joined O’Malley on Tuesday as the governor toured a wooded neighborhood in St. Mary’s County in which every home had downed trees, some of which broke through roofs and smashed back decks. “I think this is appropriate.”

McDonnell was publicly praised by longtime Norfolk Mayor Paul Fraim (D), who appeared at a news conference with him Friday at the Norfolk Emergency Operations Center. Fraim said that he has never seen a governor come to the region before a hurricane.

O’Malley and McDonnell lead the dueling partisan organizations that try to elect governors from their parties. Both have credited President Obama and FEMA for their help in responding to Hurricane Irene. During his “Meet the Press” appearance, O’Malley said the agency had come a long way since the days of Katrina.

Aides to both men acknowledged that there can be political upsides to all the exposure they receive during a natural disaster, but they also argue that governors can use the power of their office to improve public safety and the pace of the recovery.

During his many media briefings and media interviews in recent days, O’Malley has provided the latest figures on power outages — in an effort to pressure utility companies to move more quickly.

During a briefing Monday — which was carried live on some television stations — O’Malley contrasted the number of outstanding outages in the service areas of the state’s two largest electricity providers.

Aides say O’Malley thrives in hands-on situations like that of the past few days, which are more reminiscent of his former post as mayor of Baltimore than his duties as governor.

On Tuesday, O’Malley was trailed by several television cameras as he made his way down Whiskey Creek Road in Hollywood. The most frequent word out of O’Malley’s mouth was “wow” as he surveyed home damage.

“How you doin’?” the governor, wearing jeans and a green polo, said as he walked up the driveway of Sigrid Morris.

“We’re hanging in there,” said Morris, who explained that a huge tree fell into the back of her house, crashing into the living room. “Water came in like crazy.”

As the tour continued, many in the neighborhood spilled into the street to greet the governor, who joked with children about whether they were glad to be off school.

In response to a woman who thanked him for being there, O’Malley said: “It’s part of my job. Glad to do it.”

McDonnell spent the first part of last week responding to the once-in-a-century earthquake in central Virginia and the raging fire that has burned uncontrollably in the Great Dismal Swamp in southeastern Virginia since the first week of August.

He started receiving Irene updates and information early in the week and, by Thursday, aides say, he was “all hurricane, all the time,” spending most hours at the emergency operations center and speaking with local, state and federal agencies as well as companies such as Dominion Virginia Power, the state’s largest energy provider.

Through media appearances, McDonnell, like O’Malley, spent days urging residents to prepare for Irene, which he called “the most significant weather event of their lifetime.”

McDonnell has done nothing to curb speculation that he could be a vice presidential candidate next year. In recent days, he has appeared on more than a dozen national shows.

His seven news conferences were broadcast on multiple national stations, including the Weather Channel and “Today” on NBC. At each briefing, his staff tweeted real-time snippets of the information McDonnell released — as did O’Malley’s staff in Maryland.

McDonnell has visited hard hit areas as well. On Saturday, joined by Richmond Mayor Dwight Jones (D), he toured Monument Avenue, a historic street in Richmond where every other block seemed to have a massive fallen tree.

Late Tuesday, McDonnell, flanked by a pair of casually dressed U.S. Cabinet secretaries — Janet Napolitano of Homeland Security and Tom Vilsack of Agriculture — thanked the federal government for its response.

Napolitano, speaking at the packed Virginia Operations Center in Richmond, assured residents and emergency workers that FEMA will not abandon Virginia, and that any money needed for the disaster will be available despite reports that the agency does not have enough money for the disasters.

“We will be here, be here with you through the aftermath of Irene,” she said.