NEW ORLEANS — The 49ers' ability to stay composed and play from a deficit proved to be a blessing two weeks ago. At the Superdome on Sunday, it may have been a curse.

Convinced they were on the verge of another epic comeback, the Niners fell 5 yards short of a touchdown, three points short of a victory and one win short of Super Bowl perfection, losing 34-31 to the Baltimore Ravens after a last-minute drive stalled in Super Bowl XLVII.

The formula had worked to perfection in the NFC championship game, as the 49ers made up a 17-point gap and overturned the Falcons in Atlanta. But the Ravens proved more resilient. And while Jim Harbaugh was again able to rally his team, it was his older brother, John, who is a Super Bowl champion.

"The meeting with Jim in the middle (of the field) was probably the most difficult thing I have ever been associated with in my life," John Harbaugh said.

Imagine how tough it was for Jim.

If just one of Colin Kaepernick's final three throws to Michael Crabtree had been complete, we'd probably be comparing these 49ers to the great San Francisco teams of all time. Their second-half rally was stunning. Down 28-6 after Jacoby Jones' 108-yard kickoff return, they flipped the switch and had the 49ers portion of the stadium going crazy.

It started with a 31-yard catch-and-run by Crabtree that left two Ravens on the ground and cut Baltimore's lead to 28-13. Then came a nifty punt return by Ted Ginn and a 6-yard touchdown run by Frank Gore. Moments later, cornerback Tarell Brown stripped the ball from Ray Rice and recovered the fumble, setting up a David Akers field goal that made it 28-23.

You could feel the tide turning.

Even when the Ravens fought back for a field goal, the Niners looked like the fresher team. Kaepernick engineered a lightning-fast drive and ended it with a 15-yard sprint around the left end, cutting the deficit to two points. Going for the tie, Kaepernick threw incomplete on the 2-point conversion attempt.

Baltimore added another field goal to make the score 34-29, then came up with the big defensive stop. The 49ers padded their final score on a safety when Ravens punter Sam Koch ran around in the end zone to kill time and took a safety.

The first half was a nightmare for San Francisco. The dagger came with the 49ers trailing 14-3, just after the two-minute warning in the first half. Nickel back Chris Culliver had been playing well to that point, but he let speedster Jones run by him. Joe Flacco's throw hung a bit, forcing Jones to make a falling catch, and Culliver failed to touch him down.

Jones got up, eluded Dashon Goldson and beat a couple of 49ers into the end zone for a touchdown that gave Baltimore a commanding 21-3 lead.

The Ravens had struck first on a 13-yard scoring pass from Flacco to Anquan Bolden just 4:24 into the game. They added another touchdown pass in the second quarter when Flacco found tight end Dennis Pitta wide open between Patrick Willis and Donte Whitner. Both of those first-half scoring throws were right down the middle of the field.

The Niners' 15-point halftime deficit could have been worse, too. The Ravens were poised to pad what was then a 14-3 lead when John Harbaugh, a long-time special teams coach before getting the head job at Baltimore, called for a fake field goal on fourth-and-9 from the San Francisco 14. Kicker Justin Tucker took a direct snap and ran for the left edge, but Darcel McBath pushed him out of bounds a yard short and the 49ers took possession.

Kaepernick nearly threw back-to-back interceptions, too. After Ed Reed's first-half pick, Kaepernick's next throw was a toss to Randy Moss that Baltimore's Cary Williams nearly caught inside the San Francisco 15.

The 49ers' Super Bowl dreams are on hold for another year.

"You know how hard you had to work to get to this point," defensive lineman Ricky Jean Francois said. "Now what are you gonna do about it? You gonna keep your head down for the rest of your life? I understand this is gonna stay with you for a while, but you got to learn from it. As we learned from the NFC championship game last year, we got to learn from this, too, from the Super Bowl."

You can reach Staff Writer Phil Barber at 521-5263 or phil.barber@pressdemocrat.com. Follow him on Twitter at twitter.com/Skinny_Post.