The San Francisco 49ers just needed to get to third-and-16 to play their best football.

Jimmy Garoppolo came up big for the 49ers on Saturday night. After the Rams tied the game with 2:30 to go, Garoppolo hit a clutch 18-yard pass to Kendrick Bourne on third-and-16. Then on another third-and-16 in the final minute, Garoppolo found a surprisingly wide-open Emmanuel Sanders for 46 yards to set up a game-winning field goal from Robbie Gould as time expired. The Rams totally blew a coverage, leaving Sanders all alone downfield and Garoppolo found him.

The 49ers’ thrilling 34-31 win over the Rams officially eliminates Los Angeles from the playoff race, sending the Vikings to the postseason. It also sets up one of the biggest NFL regular-season games in recent memory.

[Watch live NFL games on the Yahoo Sports app, here's how]

The NFL already said that neither the Seahawks nor 49ers could clinch the NFC West before Week 17. The 12-3 49ers will be playing the 11-3 Seahawks next Sunday with the NFC West title on the line, regardless of Seattle’s game on Sunday against Arizona. It’s hard to imagine the NFL doesn’t flex that game to “Sunday Night Football.”

It’s not just the division title on the line. The 49ers might be playing a game in which they get the No. 1 seed if they win, and the No. 6 seed with a loss. That’s a strange scenario for Week 17 and some massive stakes between two powerhouse teams.

The 49ers kept that alive with a win over the Rams that was a little more exciting than they probably hoped.

49ers have a lot on the line next week at Seattle

The odd scenario in which the 49ers are playing for the No. 1 or No. 6 seed next Sunday isn’t even that complicated. The first part is easy: If the 49ers beat the Seahawks they’re NFC West champions and due to wins over the Packers and Saints, would be the first seed. The scenario with the No. 6 seed, and a likely trip to Green Bay for wild-card weekend, comes back to the 49ers’ loss to the Falcons last week.

If the Vikings beat the Packers and Bears in home games to finish the season, they’ll be 12-4. If the 49ers lose next week, they’ll also be 12-4 and a wild-card team. The tiebreaker would come down to common opponents, via the Minneapolis Star-Tribune, and the Vikings would be 3-2 in those games and the 49ers 2-3. The 49ers’ loss to the Falcons flipped that tiebreaker.

There are still plenty of things to be sorted out in Week 16, but the 49ers know with one game left that their magical season that started 8-0 and 10-1 will face a big fork in the road in Seattle. Finishing second in the division and having to go on the road in wild-card weekend — perhaps to absolutely frigid Lambeau Field — is not what most 10-1 teams dream about.

The 49ers would rather get that No. 1 seed and have a week off to sort out their issues.

Running back Raheem Mostert scores a touchdown for the San Francisco 49ers against the Rams. (Photo by Thearon W. Henderson/Getty Images) More

49ers pull out late win

The 49ers have everything in front of them as they travel to Seattle. But in some ways, this isn’t the same team that took the NFL by storm for most of the season.

The team lost last week to the Falcons, and that was a stunner. But letdown games happen, even in the NFL. The Rams game seems to multiply some of those issues.

The interior of the offensive line isn’t the same without injured center Weston Richburg, who is out for the year with a knee injury. Garoppolo had a very quiet second half throwing the ball, at least until it counted most. A lot of that was due to the pressure given up by the offensive line.

The defense that was the best in the NFC has had a few rough games in a row. The Rams moved Jared Goff around in the pocket, which slowed down the 49ers’ pass rush. San Francisco’s front four dominated the first meeting against the Rams, and Sean McVay adjusted. The Rams really didn’t have a tough time moving the ball, and that came after the Saints put up 46 points and the Falcons scored 29 on the 49ers.