INGLEWOOD, Calif. -- It was a fitting way for the San Francisco 49ers to punch their ticket to the postseason.
Left for dead at halftime much like they were at the halfway point of their season, the Niners, led by a gutsy performance from quarterback Jimmy Garoppolo, scratched and clawed their way back from a 17-point deficit for a dramatic 27-24 win in overtime against the Los Angeles Rams on Sunday.
Niners kicker Robbie Gould made a 24-yard field goal with 2 minutes, 45 seconds to go in OT, and San Francisco's defense held on for the win with the aid of the first career interception from rookie cornerback Ambry Thomas.
"Guys came together, guys made huge plays on third down, defense stepped up huge, interception by Ambry at the end there -- a rookie making that play -- all the things are coming together," Garoppolo, who played through a torn ligament in his right thumb, told Fox Sports on the field after the game. "It was a good night."
With the victory, the 10-7 Niners locked up the No. 6 seed in the NFC playoffs and will meet the Dallas Cowboys in the wild-card round next Sunday at 4:30 p.m. ET. Paired with the Arizona Cardinals' loss to the Seattle Seahawks, the Rams still clinched the NFC West and the fourth seed in the conference.
Rams wide receiver Cooper Kupp finished the game with seven receptions for 118 yards and a touchdown but fell short of setting NFL records for receiving yards and receptions in a season. Kupp needed 136 receiving yards to break Hall of Fame receiver Calvin Johnson's record of 1,964 receiving yards set in 2012, and 12 receptions to break New Orleans Saints receiver Michael Thomas' mark of 149 receptions set in 2019.
According to Elias Sports Bureau research, the 49ers' 17-point rally tied the largest comeback in a season finale to wrap up a playoff berth since 1990, joining the 1993 Raiders, who also came back from down 17 to beat the Denver Broncos in overtime to seal a postseason bid.
"You want it to go well and you want to be up early and have momentum and all that kind of stuff," 49ers linebacker Fred Warner said. "But I think that kind of shows the resilience of this football team, and I think that's the perfect type of win that we needed heading into this tournament because it's not going to be easy. The NFC is loaded with talent, and if we really want to reach our end goal, we've got to take it one game at a time and really dial in because we're going to need everyone to win versus Dallas."
After falling behind by 17 in the first half, history suggested the 49ers were on the way to a long offseason spent lamenting missed opportunities. The Niners, even without their starting left tackle, nickel cornerback, weakside linebacker, punter and strong safety, had other ideas.
Tapping into the same fortitude that allowed them to rebound from a 3-5 start and a four-game losing streak, the Niners got important contributions from all over the roster.
"Our guys are really resilient," coach Kyle Shanahan said. "Our goal every year is to get in the tournament so you've got a chance at the ultimate one, and our guys, I think it's real hard where you have a season where you lose four in a row. Most places, you lose four in a row, it's tough to keep guys together -- and just the character in the building and the players and everyone around, it makes it easy, you just focus on your job and keep fighting, and that's what our guys have done all year."
Sunday's victory was the Niners' first after facing a 17-plus-point deficit since the 2012 NFC Championship Game against the Atlanta Falcons. Over the past 20 seasons, the Niners were 3-91 when facing such deficits, including the postseason.
Likewise, the Rams had never lost a game in which they had the lead at halftime under coach Sean McVay, who was 45-0 in those scenarios since taking over in 2017. Los Angeles' streak was the second longest in NFL history, trailing only Green Bay's 49 straight from 1926 to 1933, according to ESPN Stats & Information research.
"In the moment right now, this is a tough feeling," McVay said. "Our guys did a good job being able to navigate through the season and still win the division. It's a good accomplishment, but I don't know that right now is a good time to celebrate that. We'll look at this film, we'll clean it up and we'll move forward the right way."
The 49ers' comeback win was tied for the fourth largest on the road in franchise history, and it was their sixth consecutive win against the Rams.
"Everyone made plays today whether it was run game, pass game, special teams, defense -- everybody played really well," tight end George Kittle said. "We came back and played through it."
To make that happen, the Niners needed plenty of late-game magic. They surged to tie it at 17 in the third quarter and appeared poised to take the lead before Garoppolo threw an interception to Jalen Ramsey deep in Los Angeles territory.
But Garoppolo, who entered Sunday listed as questionable with the thumb injury, showed his resolve, leading the Niners on an 88-yard touchdown drive in 1:01 to tie it with a 14-yard touchdown pass to Jauan Jennings.
Garoppolo picked up where he left off in overtime, quickly leading the Niners down the field with a pair of third-down completions to Jennings to set up the game-winning score.
Asked how his injured thumb held up, Garoppolo told Fox Sports, "It was definitely tested. It's football," before adding with a laugh, "It f---ing hurt."
"It is what it is," he continued. "We got the win and that's all that matters."
Jennings, the former seventh-round draft pick who has emerged over the past month as a key target in meaningful moments, finished with six catches for 94 yards and two touchdowns. Garoppolo finished 23-of-32 for 316 yards with a touchdown and two interceptions for a passer rating of 87.5.
They were just two of the heroes on a day when the Niners needed all hands on deck to keep this wild, unpredictable season alive.
"A lot of emotions," Garoppolo said. "Throughout the whole game, too, just the ups and downs, getting off to a slow start and then coming back like we did. It took everything. We say that a lot of weeks, but this one really did, and I felt it after the game. I know a lot of guys in that locker room did. It was worth it, though. It was one of those games that you won't forget anytime soon."
ESPN's Lindsey Thiry contributed to this report.