(CNN) — One Harbaugh will win Super Bowl XLVII. Another will lose it.

That much is guaranteed after the San Francisco 49ers, coached by Jim Harbaugh, and the Baltimore Ravens, led by his brother John Harbaugh, beat their respective foes in conference championship games Sunday. Those wins mean the Harbaughs will be the first siblings to face off as head coaches in the NFL’s title contest and, in fact, for any major U.S. professional sports championship.

Both teams rallied from halftime deficits on the road to earn berths in the Super Bowl, which will be played February 3 in New Orleans.

Baltimore did it by reeling off 21 straight points to overcome Tom Brady and the New England Patriots. It was sweet revenge for the Ravens, who lost last year’s nail-biter AFC Championship to the same Patriots foe on the same Gillette Stadium field in Foxborough, Massachusetts.

A few hours earlier, the 49ers rallied from a 17-0 hole to defeat the Atlanta Falcons, who had posted the best regular season record in the NFC.

John Harbaugh joked to reporters, after the Ravens’ win, that he and his brothers had a “few dreams” — one of which may have been meeting up in the Super Bowl — as well “as a few fights … just like all brothers.”

“We’ll let the two teams duke it out, as much as possible,” John Harbaugh said, smiling.

The Baltimore coach then made a point to talk about how proud he was of his brother Jim, as well as how much he admired the San Francisco team.

“I’d like to think that when you look at (the) two teams, you’re looking at mirror images,” John Harbaugh said, referring to the Super Bowl foes. “It’s going to be a great football game.”

Baltimore’s dominant second half leads to win

Beyond their recent playoff history, Baltimore and New England matched up earlier this season — one in which the Ravens came back from a late 9-point deficit, winning on a last-second field goal by Justin Tucker.

Still, victory Sunday evening was hardly guaranteed.

New England had the superior regular record, not to mention a storied playoff pedigree having played in five Super Bowls in the past 11 years. They also had Brady, who last Sunday passed Joe Montana as the quarterback with the most playoff wins ever.

And the Patriots started out strong, jumping to a 3-0 lead and — after a Baltimore score — entering halftime up 13-7.

But the second half was all Baltimore. The Ravens scored touchdowns on their first three possessions, two of them on Joe Flacco touchdown passes to receiver Anquan Boldin.

Meanwhile, the vaunted Patriots offense sputtered, hurt especially by a Stevan Ridley fumble and two Brady interceptions. Baltimore ended up winning 28-13.

“We came here last year and left with a bitter taste in our mouths,” Baltimore’s Boldin told reporters after the game. “We felt like this team took something away from us. And we wanted to come back and make that right.”

49ers rally, hold on for 28-24 victory

Led by quarterbacks Montana and Steve Young, San Francisco was one of the NFL’s top franchises through much of the 1980s and 1990s.

But the 49ers haven’t been in the Super Bowl in 1995, and their 2000s were marred by mostly losing regular seasons.

The team’s fortunes, however, have turned since the 2011 hiring of Jim Harbaugh, a former NFL quarterback himself who’d been coaching at nearby Stanford. The next season, they made it to the NFC Championship, only to fall to the eventual Super Bowl winners, the New York Giants.

On Sunday, trailing by three scores midway through the second quarter, San Francisco rallied for two quick touchdowns — one on a LaMichael James 11-yard run, the other on a four-yard reception by tight end Vernon Davis.

Still, Atlanta maintained its slim advantage — in part thanks to a missed field goal and a fumble by the 49ers Michael Crabtree just inches from the end zone — into the fourth quarter. But then, running back Frank Gore scored from nine yards out to put San Francisco ahead 28-24.

At this point, there were still just over eight minutes left in the game.

Atlanta — paced by quarterback Matt Ryan, known as “Matty Ice” for his strong play in the waning minutes of games — made a run. With just over a minute to go, the Falcons got within striking distance of the goal line. But San Francisco defenders broke up two straight passes, effectively sealing the win.

After the game, San Francisco linebacker Patrick Willis said the 49ers prevailed because they refused to give up and stuck together as a team, just as they have all season long.

“One thing about our team all year long is that we continue to fight,” Willis told Fox, which broadcast the game. “We have an unbelievable team.”