The Ravens won their second Super Bowl in a dozen years. Reuters

The Baltimore Ravens survived a San Francisco 49ers second-half surge, and a power failure, to win Super Bowl XLVII in New Orleans on Sunday, 34-31.

The Ravens, who led 21-6 at halftime, were outscored 25-13 in the second half, but two fourth-quarter field goals helped seal their second title in 17 years in Baltimore.

Quarterback Joe Flacco earned the MVP award after throwing for 287 yards and three touchdowns and no interceptions. The 28-year-old entered the 2012 season as a playoff underachiever, but enjoyed an excellent postseason where he threw 11 touchdowns without an interception.

A power outage delayed the game for more than 30 minutes. Half the Mercedes-Benz Superdome Stadium's lights shut off and CBS announcers Jim Nantz and Phil Simms lost their audio.

When the game resumed, the 49ers mounted a stunning comeback led by Colin Kaepernick. The young quarterback threw for 302 yards, and rushed for 62 yards, and helped lead San Francisco to 17-consecutive points to cut Baltimore's lead to 31-29.

Justin Tucker's 38-yard field goal with 4:19 remaining gave the Ravens a five-point cushion, and Baltimore would later take a safety on a punt to run the clock down to seal the victory.

"It's never pretty, it's never perfect, but it us," said Ravens head coach John Harbaugh after the game.

Harbaugh was able to win the coaching battle over his younger brother, Jim. He called beating his brother, "the hardest thing I ever experienced."

The Ravens received strong performances from wide receivers Anquan Boldin and Jacoby Jones. Boldin caught six passes for 104 yards and a touchdown.

Jones had only one reception, but it was for a 56-yard touchdown in the second quarter. Jones also returned the second-half kickoff for a record 108 yards.

The Super Bowl victory ended up being a magical sendoff for Ray Lewis. The 13-time Pro Bowl linebacker announced his retirement prior to the Ravens' first playoff game. Lewis was also on the 2001 Baltimore squad that won the Super Bowl.

"This is the way you do it," said Lewis. "No other way to go out and end a career."

While the Ravens enjoyed their second title in a dozen years, the 49ers loss was likely a tough pill to swallow. San Francisco entered the 2012 season as one of the elite teams in the league, and entered the championship game as three-point favorites. The 49ers enjoyed an impressive playoff run, and appeared to have momentum behind the promotion of Kaepernick to starting quaterback over opening-day starter Alex Smith.

San Francisco turned the ball over twice, and failed to capitalize on outperforming the Ravens in total yards, 468-367. Running back Frank Gore rushed for 110 yards on 19 carries.

It was the first Super Bowl loss in the 49ers' history.

The Ravens' title will likely be remembered by Lewis retiring as a champion. His post-game celebration and interview were indicative of his enthusiasm for the game.

"It's no greater way, as a champ, to go out on your last ride with the men that I went out with my teammates," Lewis said. "And you looked around this stadium and Baltimore! Baltimore! We coming home, baby! We did it!"