The Baltimore Ravens survived a furious second-half rally by San Francisco and a momentum-sapping power outage at the Superdome to defeat the gritty 49ers 34-31 in the Super Bowl.

A Super Bowl-record 108-yard kickoff return for a touchdown by Jacoby Jones to open the second half gave the Ravens a 28-6 lead but the 49ers scored 17 straight points after a 35-minute power outage and nearly pulled off a stunning comeback victory.

"Both teams had to deal with it," Ravens coach John Harbaugh said of the power outage. "They dealt with it better, obviously. They were able to turn the momentum of the game."

Trailing 34-29, the 49ers marched down to the Ravens' seven but failed to score on four attempts, surrendering the ball on downs at the five with less than two minutes remaining.

Baltimore's lead evaporated because the 49ers' talented second-year quarterback, Colin Kaepernick, suddenly found the form that made him one of the league's most dangerous quarterbacks this season.

Despite a shaky first half, Kaepernick completed 16 of 28 passes for 302 yards and a touchdown. He also ran for 62 yards and a 15-yard touchdown on seven carries to finish behind Frank Gore (110 yards) as the 49ers' second-leading ground gainer.

Kaepernick's rushing score with 2 minutes and 57 seconds left cut the Baltimore lead to 31-29 but his pass attempt on the two-point conversion attempt was incomplete.

A 38-yard field goal by Justin Tucker with 4min 19sec left in the game boosted the Ravens' lead to 34-29, setting the stage for what could have been a Super Bowl-record comeback by the 49ers.

But the Ravens' defence, anchored by retiring future Hall of Fame linebacker Ray Lewis, came up big when it had to with a goal-line stand and handed the 49ers' franchise its first Super Bowl loss after five victories.