Detroit Lions 31-34 San Francisco 49ers: Brock Purdy and Christian McCaffrey inspire their team to a remarkable second-half comeback as they set up a Super Bowl rematch with the Kansas City Chiefs in Las Vegas

Step aside Taylor Swift. Mr. Irrelevant and his own group of superstars are headed to the Super Bowl after a remarkable comeback by the San Francisco 49ers saw them beat the Detroit Lions.

Christian McCaffrey, Deebo Samuel, Brandon Aiyuk, George Kittle and Nick Bosa all played their part, but it was a pair of Brock Purdy touchdown passes within minutes of each other that changed the course of this game in the third quarter.

Yes, the 49ers were given another scare by Dan Campbell’s team here – a week after they also pushed past the Green Bay Packers – but that’s the mark of champions to pull victory from the jaws of defeat .

Kyle Shanahan’s team was completely lifeless on both sides of the ball for two and a half quarters. The atmosphere at Levi’s Stadium was flat.

But Purdy exorcised his demons from that night in Philadelphia 12 months ago where an elbow injury sidelined him to pull off a turnaround for the ages and win the NFC Championship.

The San Francisco 49ers are headed to the Super Bowl after beating the Detroit Lions on Sunday

The San Francisco 49ers are headed to the Super Bowl after beating the Detroit Lions on Sunday

Brandon Aiyuk catches the ball after it bounces off Kindle Vildor for a big 49ers run

Brandon Aiyuk catches the ball after it bounces off Kindle Vildor for a big 49ers run

Christian McCaffrey scored two touchdowns to turn the game in San Francisco's favor

Christian McCaffrey scored two touchdowns to turn the game in San Francisco’s favor

Brock Purdy celebrates after handing the ball to McCaffrey for his second score of the game

Brock Purdy celebrates after handing the ball to McCaffrey for his second score of the game

Now they head to Las Vegas with the goal of righting another wrong. The Kansas City Chiefs beat them in a 51-point spectacle in the 2020 Super Bowl and this year promises to be another epic.

As for the Lions, they played the first half with the ‘grit’ Campbell demands. They dominated the 49ers at their own spot and while it may be hard to see right now, the future is bright and their momentum as a franchise is scary.

Some thought the intensity of playing in the Lions’ first NFC Championship game in 32 years would weigh too much on them. But within 100 seconds, and driven by thousands of Lions fans in California, they blew that idea away.

It took them just four plays and 75 yards to stun Levi’s Stadium. Jameson Williams finished off a clinical first drive from Jared Goff and burst through the gaps opened up for him by Detroit’s presumably depleted offensive line.

Desperate 49ers defenders nearly tackled him to the floor, but Williams stayed upright and ran toward the end zone. If that didn’t get the home crowd fired up, what came next certainly did.

After 49ers kicker Jake Moody drilled his first field goal attempt from 48 yards out, Goff and the Lions picked up right where they left off.

Precisely, he led them in 12 games over five minutes on the field. The 49ers just had no answer for Detroit’s run game and David Montgomery crossed to make it 14-0.

Jameson Williams scored the first touchdown within 100 seconds and tripped over the line

Jameson Williams scored the first touchdown within 100 seconds and tripped over the line

Williams' score sparked wild celebrations among the thousands of Lions fans in Santa Clara

Williams’ score sparked wild celebrations among the thousands of Lions fans in Santa Clara

Things got even better for the Lions when David Montgomery drove over from close range

Things got even better for the Lions when David Montgomery drove over from close range

McCaffrey won’t let the 49ers lose to the Packers last week. He then single-handedly won them to victory and he got them going again here.

He caught a pass from Purdy and turned it into a 28-yard gain thanks to brutal handoffs and a refusal to go down.

The quarterback then hit one from two yards out to get his team on the scoreboard. There was life back in the stands. For a minute or so anyway.

Montgomery knocked the stuffing out of them almost immediately with a 14-yard run before St. Brown caught a pass on 3rd & 11 to cut through the deafening noise.

It wasn’t until Dre Greenlaw took a stinger after a big hit on Sam LaPorta – leaving him briefly in the blue tent – that the 49ers managed to get the Lions’ offense off the field.

But they were soon back on it when a Purdy pass intended for Samuel was thrown into the grateful arms of Malcolm Rodriguez. Goff punished Purdy with an inch-perfect pass through the eye of a needle to St. Brown, leaving them 15 yards short.

From there, Jahmyr Gibbs made the most of more lackluster 49ers tackles to convert and put the Lions up 21-7. A Michael Badgley field goal made it 24-7 for the Lions at halftime. They could smell Vegas.

So poor were the 49ers, the atmosphere for much of the third quarter was stunned and accepting. Moody converted a field goal, but hope seemed lost and defeat inevitable. But then the game turned on one big luck.

Desperately needing a spark, McCaffrey burst into life with a powerful run for a big gain

Desperately needing a spark, McCaffrey burst into life with a powerful run for a big gain

The fullback then scored the home team's first touchdown to close the gap to seven

The fullback then scored the home side’s first touchdown to close the gap to seven

Jahmyr Gibbs continued Detroit's dominance in the run game and scored his own touchdown

Jahmyr Gibbs continued Detroit’s dominance in the run game and scored his own touchdown

Dan Campbell's team dominated the first half but had no answer for the 49ers late

Dan Campbell’s team dominated the first half but had no answer for the 49ers late

Kyle Shanahan has pulled off a big comeback for his team, which will play the Chiefs in Vegas

Kyle Shanahan has pulled off a big comeback for his team, which will play the Chiefs in Vegas

Purdy swung for the fences and threw long to Aiyuk. He couldn’t reach it, but the ball cannoned off defender Kindle Vildor and landed in the receiver’s arms. The 49ers fans were suddenly awake.

Purdy then threw a pass to Aiyuk for the touchdown and all of a sudden there was hope again. Momentum shifted in an instant and from there it looked like there was only going to be one winner.

After regaining possession, Purdy showed off his running game with a 21-yard gain that put his team back in scoring position. As reliable as ever, McCaffrey converted from a yard to tie things at 24-24.

From pure control to pure chaos: the Lions never recovered. Where Goff was composed and the running game was working, they couldn’t get anything going anymore.

The 49ers took the lead for the first time with just under 10 minutes to play when Moody converted a 33-yard field goal.

Campbell is never afraid to go for it on big plays. With 7:32 left in the fourth quarter and his team down by three, he went for it on 4th and 3 from about 32 yards.

Goff had to scramble out of the pocket and his pass was short. Who knows what could have happened if he had taken the field goal and tied things up.

The decision to go for it was compounded by the fact that the 49ers ended the game on their next drive.

Once again Purdy scrambled with his legs and made great ground to put his team in a scoring position. Again, McCaffrey made a powerful run to take the 49ers to yards from the keeper.

And then fellow running back Elijah Mitchell converted to secure his team’s spot in the Super Bowl.

Williams grabbed his second touchdown of the night for the Lions to make it a three-point game, but the 49ers held on to punch their ticket to the Super Bowl.

More to follow.