(Click here, if you are unable to view this photo gallery or video on your mobile device.)

LOS ANGELES – A five-game win streak ushered the 49ers out of 2017 and into a bright future under coach Kyle Shanahan, quarterback Jimmy Garoppolo and a gritty supporting cast.

Sunday’s sendoff was a 34-13 rout came over the NFC West-champion Los Angles Rams, who rested their marquee players for next weekend’s wild-card playoffs.

“It’s kind of a shame it’s coming to an end this year,” left tackle Joe Staley said. “That’s coming from a guy that’s in Year 11 and is 33 years old. I just wish we had more games. I feel definitely we’re trending in the right direction and we’re a special team here.”

By winning six of their final seven games, the 49ers’ 6-10 record matched the Raiders’, and a coin flip will determine which team drafts No. 9 or 10 overall.

A frightening sight did interrupt the 49ers’ going-away party: wide receiver Marquise Goodwin sustained a concussion on an illegal hit, got carted off the Coliseum field and went to a hospital for a precautionary examination. He checked out OK, greeted teammates in the locker room and was to fly home with the team.

Earlier, Goodwin set the rout in motion by scoring the 49ers’ first touchdown on a pass from Garoppolo. By game’s end, the 49ers had a season-high 463 yards.

When Garoppolo’s second touchdown pass found Aldrick Robinson to open the fourth quarter, the 49ers had a 28-point lead, and offensive linemen swarmed to congratulate Garoppolo on basically the crowning moment of his great stretch run as their 5-0 starter.

As for Shanahan, no first-time coach pulled off what he did this season, making it one of the more remarkable efforts in NFL history. As a result, this was the 49ers first finale since 2013 that didn’t mark the end of a head coach’s tenure.

Even when they started 0-9, Shanahan kept the young team together, amid an array of injuries, the sudden release of NaVorro Bowman and a historical stretch of losing five straight games by three or fewer points.

“To start out 0-9, that was a lot of adversity for us,” Shanahan said. “It’s not a coincidence that no (previous) team after that has finished with more than three wins. That’s adversity and it usually tears people apart.

“But we have a bunch of good people in our locker room and they stayed together. They grew tighter from it. We got better from it.”

Keying that turnaround, of course, was Garoppolo’s arrival in an Oct. 31 trade from the New England Patriots, who went on to clinch the AFC’s No. 1 seed behind reigning Super Bowl MVP Tom Brady.

“These guys don’t look at themselves as an 0-9 team or whatever they were,” Garoppolo said of his first impression joining the 49ers. “I think it was just the atmosphere in the locker room. A great group of guys coming together. It’s a blessing that I came here and good things are happening.”

Garoppolo now becomes the 49ers’ top offseason priority. If a multi-year deal can’t be reached, the 49ers will use the franchise tag on the league’s hottest free agent. He had two passes intercepted Sunday for the first time in his career. But he was sharp early, going 5-of-5 for 56 yards on the 49ers’ first touchdown drive, which culminated in Goodwin’s 8-yard score for a 10-0 lead.

“We’ve learned how to win, and that’s big,” fullback Kyle Juszczyk said.

Added Shanahan: “I’d love to carry this over (to 2018). We loved how we finished this year.”

The Rams (11-5) are the NFC’s No. 3 seed and will host Atlanta in Saturday’s wild-card round.

KEY IMPRESSIONS

EXIT STRATEGIES: Running back Carlos Hyde’s final contract push came with two touchdowns and raised his season total to a career-best eight touchdowns. His first score Sunday was an 8-yard run helped by his linemen pushing the pile like a blocking sled the final five yards. Hyde’s second touchdown came on a 5-yard run for a 27-6, third-quarter lead.

At one point in the fourth quarter, both Hyde and rookie backup Matt Breida both had 12 carries for 72 yards. Hyde fumbled with 3:48 remaining, his only lost fumble of the season.

Other starters unsigned for 2018 are Garoppolo, safety Eric Reid, center Daniel Kilgore, right guard Brandon Fusco, linebacker Brock Coyle, defensive end Tank Carradine and cornerback Dontae Johnson. All had positive showings, and Reid made several hard hits for tackles in the first half to help set the defense’s tone.

CHUNK PLAYS: As much as Shanahan’s offense covets a deep-ball threat, they’ve thrived under Garoppolo with intermediate completions that result in big gains. For example, on the first touchdown drive, he started it with a 17-yard pass to Kittle and a 20-yarder to Goodwin.

Eight players had a catch longer than 10 yards, but none longer than a 44-yarder from Kittle on the game’s opening series en route to his first career 100-yard game. Trent Taylor had a 15-yard, third-down conversion. Garrett Celek had a 28-yard catch to set up a touchdown. Pro Bowl-bound fullback Kyle Juszczyk had a 14-yard catch, rookie Kendrick Bourne a 16-yarder and Robinson his 12-yard touchdown for his second score of the season. Matt Breida capped that big-play display with a 32-yard catch-and-run in the final minutes.

HARD TO JUDGE: The 49ers are 2-0 at the Coliseum since the Rams returned from St. Louis. Unlike last season’s Christmas Eve comeback win, this one came against a Rams squad that rested its top players. The 49ers run defense did not allow a 100-yard rusher for the seventh straight game, but how would it have fared if NFL rushing leader Todd Gurley been active? How would Jared Goff have performed rather than first-time starting quarterback Sean Mannion?

The Rams announced 17 lineup changes before kickoff, and their second-stringers obviously couldn’t keep pace with the 49ers. That said, the 49ers dominated this game so much that it will help their quest to unseat the Rams atop the division in 2018.

KEY PLAYERS

49ers QB Jimmy Garoppolo: He improved to 5-0 as the 49ers starter by completing 20 of 33 for 292 yards with two touchdowns and two interceptions. Fans behind the 49ers bench chanted “Jim-my! Jim-my” with just over two minutes remaining.

49ers RB Carlos Hyde: He had 15 carries for 90 yards, as well as two catches for 10 yards.

49ers TE George Kittle: He had four catches for 100 yards, highlighted by his 44-yard catch on the opening series.

Rams QB Sean Mannion: The San Jose native and Foothill High-Pleasanton product had a few passes sail high and a few dropped in his starting debut. He was 20-of-34 for 169 yards with no touchdowns or interceptions.

Rams RB Malcolm Brown: Starting in place of Gurley, Brown had 14 carries for 54 yards.