(CNN) -- Ray Lewis had to wait a half hour, but the Raven got the swan song he wanted.
The renowned linebacker, considered by many to be one of the greatest to ever play the game, went out a winner, as the Baltimore Ravens beat the San Francisco 49ers 34-31 in a Super Bowl delayed by a third-quarter power outage.
"What better way to go out," Lewis said after the Sunday night win at the Superdome in New Orleans.
"The things that we have been through all year, we were battle tested through this journey, the up and down roller coaster, the injuries, the passings of people. We stayed together, and now I get to ride off into the sunset with my second ring."
The Ravens took a 22-point lead before the 49ers rallied after a 35-minute delay for a power failure.
San Francisco got within two points, but Baltimore held on.
"We talk to our guys all the time, it's never very pretty, it's never perfect but it is us," Baltimore coach John Harbaugh said.
It is the second victory in the NFL championship for the Ravens, who also won Super Bowl XXXV.
It was also a bitter sweet one for coach John Harbaugh. His younger brother, Jim, is the 49ers' coach.
Lights go out
About 90 second into the third quarter and with the Ravens leading 28-6, the power in about half of the Superdome went out.
The referee called a halt to the game, while stadium officials worked to fix the problem. Players sat on the field, stretching or talking to one another. Spectators -- and there were 71,024 in attendance -- mostly stayead in their seats.
About 35 minutes later -- and with the cause of the outage not fully known -- the game resumed.
The break in play appeared to help the 49ers, who scored three times in just over four minutes.
Michael Crabtree scored on a 31-yard touchdown throw from Colin Kaepernick and Frank Gore scored on a six-yard run. David Akers kicked his third field goal of the contest as the 49ers scored the first 17 points after the near blackout.
"I felt our guys battled, they competed," losing coach Jim Harbaugh said. "We got a spark, and we weren't going to look back. It was a heck of a football game."
'Heck of a football game'
After Ravens rookie Justin Tucker kicked a field goal, Kaepenick scored on a 15-yard scamper -- the longest touchdown run by a quarterback in Super Bowl history.
The 49ers went for a two-point conversion that would have tied the score, but Kaepernick threw too high.
Another Tucker field goal made it 34-29 Ravens before the 49ers had their final shot.
The 49ers drove to the Ravens' five-yard line but Kaepernick's lofted pass to Crabtree sailed out of bounds with 1:49 remaining.
Jim Harbaugh pleaded with the officials to call a holding penalty on the Ravens' defensive back, but there was no flag.
After running three plays, the Ravens took a safety with four seconds left in the game instead of punting out of their end zone.
The 49ers ran out of time as they returned the game-ending free kick.
Ravens' quarterback Joe Flacco -- who was selected as the game's most valuable player -- was 22 of 33 for 287 yards. Kaepernick was 16 of 28 for 246 yards.
Flacco threw red-zone touchdown passes in the first half -- the first to Anquan Boldin and another to Dennis Pitta.
He also hit Jones for a 56-yard touchdown pass, where the wide-open receiver fell down catching the ball at the 8-yard line, got up and evaded one defender before sprinting into the end zone.
Late Sunday night, euphoric Baltimore residents spilled into the streets, dancing and waving flags. Many darted in between cars, which in turn honked their horns and joined in the celebrations.
"I think it's a very exciting time for us," City Police Commissioner Anthony Batts told CNN. He said his officers were keeping an eye but were letting residents enjoy themselves.
"We have a number of residents that are out doing celebratory jumping in the street, which is normal and expected."
Back in New Orleans, the Harbaugh brothers met at midfield after the game.
"I told him I was proud of him" Jim Harbaugh said. "I think he said the same."