SANTA CLARA, Calif. (AP) Brock Purdy's throws were off-target all night. The San Francisco defense kept giving up big plays. There were even a couple of special teams blunders.

Just when it seemed like the top-seeded 49ers might be sent home in their first playoff game, they did something they hadn't managed to do all season: mount a late-game comeback.

Christian McCaffrey capped a game-winning, 69-yard drive by running for his second touchdown with 1:07 to play, and the 49ers held on to beat the Green Bay Packers 24-21 in a divisional-round thriller on Saturday night.

“We’re built for those moments,” McCaffrey said. “We didn’t play well at all but still had a chance at the end. To go out there and execute is a sign of a high character team.”

After spending all regular season as front-runners, the Niners (13-5) rallied behind Purdy and McCaffrey to reach their third straight NFC championship game. And they will host it this time after losing the past two on the road. San Francisco will play the winner of Sunday's game between Tampa Bay and Detroit next weekend for a spot in the Super Bowl.

Purdy went 6 for 7 for 47 yards on the decisive drive, converting a third down with a 10-yard pass to Brandon Aiyuk and throwing a 17-yarder to Chris Conley.

“Obviously it’s four quarters for a reason, you know? So the way I started, it’s like, ‘Man, I’ve got to be better, got to play efficient football,’” Purdy said. “But when it comes down to it, with the season on the line, you’ve got to make it happen for your boys around you.”

McCaffrey finished it off with his 6-yard run on third-and-short and the 49ers' defense held on from there, with Dre Greenlaw intercepting Jordan Love for the second time to seal San Francisco's fifth straight playoff win over Green Bay (10-9).

“We feel exhausted,” linebacker Fred Warner said. “That took everything. It took everyone. We knew it’d be a close game. That’s a heck of a team. They give us everything. This is the playoffs. We knew we had to find a way to win no matter what.”

That last throw across his body was one of the few mistakes by Love, who had given the Packers the lead with two TD passes in the third quarter. But his first full season as the starter in place of Aaron Rodgers had a disappointing ending.

“It’s tough,” Love said. “Very tough. We had an opportunity to win that game and didn’t capitalize on it. It’s a tough way to end the season.”

Purdy - who struggled with his accuracy early on a rainy night - threw for 252 yards and a touchdown, and McCaffrey rushed for 98 yards on 17 carries.

Love put the Niners in the unusual spot of playing from behind. Green Bay converted a third-and-15 when Ambry Thomas was called for a 41-yard pass interference penalty against Bo Melton. Love and Melton connected on the next play for a wide-open 19-yard touchdown aided by Tashaun Gipson slipping on the wet grass in coverage.

After McCaffrey put San Francisco back in the lead with a 39-yard TD run, Green Bay struck quickly thanks to a 73-yard kick return by All-Pro Keisean Nixon that he fumbled, only to have teammate Eric Wilson recover.

Four plays later, Love threw a 2-yard touchdown pass to Tyler Kraft and the Packers extended the lead to 21-14 on a 2-point conversion pass to Aaron Jones.

“It was the story of our whole team,” 49ers coach Kyle Shanahan said. “There was times when we were all off.”

The Niners were the first team to make the playoffs in 13 seasons without overcoming a second-half deficit to win a game.

They got a 52-yard field goal from Jake Moody on the first play of the fourth quarter to make it a four-point game, and it stayed there when rookie Anders Carlson missed a 41-yarder for Green Bay.

The Packers moved the ball easily in the first half, getting into the red zone on three straight drives to open the game. But they couldn't finishing any of them off, setting for two field goals and getting stopped on a fourth-and-1 sneak. They became the first team in 20 years to reach the red zone on their first three drives of a playoff game without getting a TD.

The Niners made them pay for that with Purdy hitting George Kittle on a 32-yard pass on the run for a TD that gave San Francisco the lead.

But San Francisco squandered another chance late in the half when Shanahan wasted time before settling for a 48-yard field goal attempt by Moody that was blocked by Colby Wooden to send the Niners into the half with a 7-6 lead.

Jones finished with 108 yards on 18 carries for the Packers, and Love was 21 of 34 for 194 yards for the Packers, who overcame a 2-5 start to the season to make it this far.

“For us to lose this game certainly stings and I’m sure it’s going to sting for a long time,” coach Matt LaFleur said. “But I was proud of the effort of our guys, our ability to weather some real adversity throughout the course of the season and stick together.”

INJURIES

Packers: RT Zach Tom left in the third quarter to get checked for a head injury and didn't return.

49ers: WR Deebo Samuel injured his shoulder on the opening drive and missed most of the game.

---

AP NFL: https://apnews.com/hub/NFL

Copyright 2024 STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.