The Crescent City’s unique brand of voodoo threatened to sneak up on the Baltimore Ravens, the kind of dark magic that defies logic and explanation but maybe not fate.

“Is it real? Is it real?” Ravens safety Ed Reed would later say in disbelief.

But nothing could darken this day for the Ravens. When it was all over and the mercurial team flickered back to life to win Super Bowl XLVII, Baltimore players embraced the gleaming Vince Lombardi Trophy. Their brilliant leader was able to go out on top, and their understated quarterback showed that the future looked bright, too.

A game marred by a power outage that stopped action for more than a half-hour, embarrassing the National Football League and forcing CBS broadcasters to scramble, ended with linebacker Ray Lewis in tears and his Ravens firmly on top, 34-31, victors over a San Francisco 49ers squad that fell just five yards shy of a historic comeback.

“It wasn’t perfect, it wasn’t pretty, but it was us,” said Ravens Coach John Harbaugh. “And that’s who we are.”

On the field, Harbaugh walked through the rain of purple and gold confetti to find 49ers Coach Jim Harbaugh, siblings experiencing the biggest game of their lives in starkly different ways. The Ravens coach drew his younger brother close and told him he loved him.

“It’s a lot tougher than I thought it was going to be,” the elder Harbaugh said of facing his brother.

With the end of the game, doors swung open in several Baltimore neighborhoods, including Federal Hill, as jubilant fans swarmed into the streets to join in a vast celebration.

Horns honked, fireworks popped and sparkled and here and there people stood on porches to watch and join in the general boisterousness. Others rolled by in a pickup truck, but for the most part, traffic came to a standstill as fans swarmed into the streets.

The win marked the Ravens’ second Super Bowl title and their first since 2001. It also drew together the organization’s past and its future. Lewis, the flashy and outspoken face of the franchise for so long, played his final game Sunday.

“BAL-TI-MORE!” he bellowed as he accepted the championship trophy before a partisan, purple-clad crowd, announced at 71,024 before the 49ers faithful retreated to the French Quarter to deal with the loss.

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

On the other side of the ball, quarterback Joe Flacco etched his name in the team’s history books as he cemented his place in its future. This might have been Lewis’s team the past several years, but Flacco was named the Super Bowl MVP and he now carries Baltimore’s torch. Even a power outage couldn’t stop him.

Flacco sparkled in the first half Sunday, and diehard Ravens fans could already envision the victory parade back home moving past the Inner Harbor. And then it got better.

Jacoby Jones, the Ravens’ speedy offseason addition, opened the second half by fielding a 49ers kickoff and returning it 108 yards for a touchdown, giving Baltimore a 28-6 lead and the kind of momentum that should have made the remaining minutes of the game a formality. No team had ever blown such a big lead in the Super Bowl.

But no one could have foreseen what happened next. One minute the Ravens were celebrating in the end zone. The next, they were in the dark.

For more than 34 minutes, players milled about, not sure why the power was out and whether it would come back. Somehow, during the break, the Ravens’ momentum wandered to the other side of the field.

League officials weren’t able to immediately explain the outage, but when play resumed, the 49ers were clearly energized.

That 22-point lead disappeared quickly. San Francisco quarterback Colin Kaepernick threw a 31-touchdown pass to Michael Crabtree. Frank Gore scored from six yards out, and then Kaepernick ran in a touchdown as well. Before long, the Ravens led, 31-29.

“We don’t make anything easy,” Flacco said.

The 49ers were on the verge of history. Kaepernick moved the 49ers to the Baltimore 5-yard line. But a fourth down pass with 1 minute 50 seconds remaining in the game fell incomplete and the Ravens held on.

“It’s fitting that we won that way,” Flacco said. “We’re a tough blue-collar city. That’s the way our games come down.”

While the season concluded with Lewis, Flacco & Co. hoisting the Lombardi Trophy, the path here was hardly smooth. The Ravens closed the regular season losing four of their final five games and limped into the playoffs apparently destined for another long offseason.

Their playoff run was highlighted — some say overshadowed — by the travails of their star linebacker. Lewis had been the leader of the franchise almost since the day he was drafted in 1996. His life and 17-year career had as many highs as lows, and this season was no different. A torn triceps forced him to miss the final 10 games of the regular season.

As he prepared to return for the playoffs, he told his teammates, and then the media, that he would retire at the end of the postseason, providing plenty of January grist for those who both love and hate one of the game’s most polarizing players. For many teammates, though, it provided added motivation.

“This is the end of the Ray Lewis chapter,” said defensive tackle Arthur Jones, “and we wanted to end it right for him.”

In Lewis’s absence, Flacco — as inconspicuous as Lewis is flamboyant — began to show the ability to help the Ravens return to the Super Bowl. His performance Sunday underscored what everyone in Baltimore already knew: The team’s success will likely hinge on his right arm for years to come.

Flacco will need a new contract this offseason, but team owner Steve Bisciotti has made clear that he feels the quarterback’s long-term future in Baltimore is safe.

“Bottom line is we have our quarterback for the next 10 years and we’re going to ride Joe,” Bisciotti said in the days before the Super Bowl. “We said the last couple of years that we believed that he could get us to Super Bowls and win some.”

Staff Writer Peter Hermann contributed to this report from Baltimore