NEW ORLEANS — Ray Lewis says he’s leaving and Ed Reed says he’s staying.

Both of the primary stalwarts of the Baltimore Ravens dominating defense of the past decade-plus left the Mercedes-Benz Superdome with a victory in Super Bowl XLVII, Lewis’ second and Reed’s first.

Baltimore’s down-to-the-wire 34-31 victory over the San Francisco 49ers was far from a vintage defensive performance, but it was indicative of how this team has evolved this season.

The Ravens got back to the Super Bowl for the first time in 12 years because their souped-up offense was able to carry the team when the aging and banged-up defense was no longer able to as it had done in the past.

When Lewis returned from a triceps injury and announced just before the playoffs began that this postseason would be the final chapter in a surefire Hall of Fame career, the defense showed glimpses of its glory days in victories against Indianapolis, Denver and New England.

Twelve years ago, Lewis was the Most Valuable Player as the Ravens beat the New York Giants in Super Bowl XXXV, but on this day he was a 37-year-old spiritual leader.

“There’s no greater way as a champ to go out on your last ride than with the men I went out with,” Lewis said. “We had to overcome a lot this season with the injuries, but we stuck together and now I get to ride off into the sunset with my second ring.”

Reed, an 11-year veteran playing near his hometown, has been worn down by injuries over the years but plans to continue playing in the post-Lewis era.

He made a second-quarter interception that should have led to points but didn’t when a fake field goal failed. But the interception helped establish field position that ultimately yielded a touchdown after Baltimore’s defense forced a three-and-out after the special teams failure.

No NFL team has ever lost a Super Bowl after leading by more than 10 points, but this proud defense nearly squandered a 22-point lead as it gave up 468 yards before holding on.

The Ravens took a 28-6 lead when Jacoby Jones returned the second-half kickoff 108 yards for a touchdown.

This defense in its prime would have had the game well in hand. But in 2013 it couldn’t deliver the knockout punch.

When San Francisco failed on a two-point conversion that would have tied the score at 31 in the fourth quarter, Joe Flacco and the Baltimore offense put together a drive that gave the Ravens defense a much-needed breather and extended the lead to five points on Justin Tucker’s field goal with 4:19 left.

The 49ers, who had scored on their last four possessions, started marching into scoring range once again.

They reached a first-and-goal at the 7 with a little more than two minutes left, but a 2-yard run and two incompletions by Colin Kaepernick set up fourth-and-goal from the 5.

Baltimore blitzed and made Kaepernick hurry his throw to Michael Crabtree. Reed came over to help, but it was cornerback Jimmy Smith who had to handle Crabtree. He had his hands on him as Kaepernick’s pass floated harmlessly out of bounds and no flag was thrown.

“That last drive was a display of Ray Lewis’ character,” Reed said.

Though the Ravens still had to run three offensive plays, they took a safety from punt formation and had to stop a free kick, the defense’s work was done.

It wasn’t a typical performance of the Lewis-Reed defense in its prime, but it was good enough.

“At the end of Ray Lewis’ career we have a goal-line stand to win the Lombardi Trophy,” Ravens coach John Harbaugh said. “How could it end any other way?”