NEW ORLEANS (AP) -- From blowout to blackout to shootout, Joe Flacco and the Baltimore Ravens had just enough power to survive one of the most electric Super Bowls ever.
The outage flipped a switch for the San Francisco 49ers, but the Ravens used a last-gasp defensive stand to hold on Sunday night, 34-31.
[Photos: Best Super Bowl Halftime Shows]
America's biggest sporting event came to a half-hour standstill in the third quarter when most of the Superdome lights and the scoreboards went dark. By then, the Ravens had a 22-point lead.
Everything changed after that, though, and the 49ers staged a sensational rally before Ray Lewis and Co. shut it down. But there were plenty of white-knuckle moments and the Ravens (14-6) had to make four stops inside their 7 at the end.
[Photo: Biggest Upsets In Super Bowl History]
For a Super Bowl with so many subplots, it almost had to end this way.
Flacco's arrival as a championship quarterback coincides with Lewis' retirement - with a second Super Bowl ring no less. The win capped a sensational month since the star linebacker announced he was leaving the game after 17 Hall of Fame-caliber years.
The sibling rivalry between the coaching Harbaughs went to John, older than Jim by 15 months.
"How could it be any other way? It's never pretty. It's never perfect. But it's us," John Harbaugh said. "It was us today."
The loss of power delayed the game 34 minutes and left players from both sides stretching and chatting with each other. It also cost Baltimore whatever momentum it built, and that was considerable after Jacoby Jones ' 108-yard kickoff return and game MVP Flacco's three touchdown passes made it 28-6.
Back came San Francisco (13-5-1) in search of its sixth Lombardi Trophy in as many tries.
Michael Crabtree 's 31-yard touchdown reception on which he broke two tackles made it 28-13. A couple minutes later, Frank Gore 's 6-yard run followed a 32-yard punt return by Ted GinnJr., and the 49ers were within eight.
Ray Rice 's fumble at his 24 led to David Akers ' 34-yard field goal, but Baltimore woke up for a long drive leading to rookie Justin Tucker 's 19-yard field goal.
San Francisco wasn't done challenging, though, and Colin Kaepernick 's 15-yard TD run, the longest for a quarterback in a Super Bowl, made it 31-29. A 2-point conversion pass failed when the Ravens blitzed.
Tucker added a 38-yarder with 4:19 remaining, setting up the frantic finish.
Kaepernick couldn't get the Ravens into the end zone on the final three plays - there was contact on Crabtree on the final pass that appeared incidental - and Ravens punter Sam Koch took a safety for the final score.