SANTA CLARA, Calif. (AP) Jimmy Garoppolo‘s late-season performance sends the San Francisco 49ers into the offseason with more optimism than typical for a team with a losing record.

Now the most important task of the offseason is locking up Garoppolo with a long-term deal.

“We’re going to work hard to try to keep him as a 49er for a long, long time,” general manager John Lynch said Tuesday. “We’re really happy with the way he played. We think he’s got some abilities that are unique and we want him here.”

Garoppolo’s arrival totally transformed a team that began the season with nine straight losses under first-year coach Kyle Shanahan and ended it with five straight wins after Garoppolo took over as starter.

He threw for 1,542 yards during those starts and looked the part of a franchise quarterback the Niners (6-10) hoped they had acquired when they dealt a second-round pick to New England at the trade deadline.

“Obviously, Jimmy came in and he was fabulous,” Lynch said. “He was great for us and he made people around him better and I think that’s the mark of a player who has an opportunity to be special is do you make people around you better? He did that.”

Now Garoppolo is eligible for free agency in March, although he won’t hit the open market. If the 49ers can’t reach a long-term deal in the coming weeks, they will use the franchise tag to lock him up for 2018 for about $25 million.

“I like being here,” Garoppolo said. “I think we had a good thing going at the end of this year. And we’ll see what happens.”

Here are some issues the 49ers will face this offseason:

HISTORIC TURNAROUND: The Niners became just the second team to finish with a losing record despite winning the final five games, joining the 1989 Detroit Lions. They also set doubled the previous high win total for a team that started the season 0-9, leading to the good will around the franchise.

“That’s why this year was so special,” left tackle Joe Staley said. “We’re 6-10 at the end of the season, but I don’t think there’s a team in the NFL that would want to see us right now in the playoffs. We just got to carry that momentum in the offseason and continue to work like we did this year in the second half. We’re excited about next year.”

ROARING ROOKIES: The other major bright spot in San Francisco was the play of the rookie class. The Niners got major contributions from several rookies led by first-round linebacker Reuben Foster, who should be a centerpiece of the defense for years to come. Receiver Trent Taylor and tight end George Kittle each caught 43 passes, Matt Breida was a solid backup running back and safety Adrian Colbert and cornerback Ahkello Witherspoon showed signs of being long-term contributors in the secondary.

FREE AGENCY: The 49ers will be able to spend big in free agency if they choose thanks to more than $110 million projected in salary cap room. Some of the biggest decisions outside of getting a deal done with Garoppolo will be about their own players. Running back Carlos Hyde, safety Eric Reid and center Daniel Kilgore are among the most prominent potential free agents. Hyde and Reid had strong finishes to their season and will likely get offers from other teams if allowed to hit the open market. Kilgore helped ease Garoppolo’s transition and the Niners may want to keep him to provide continuity on the line.

GET HEALTHY: San Francisco had 23 players end the season on injured reserve, including several the team is counting on to be healthy contributors in 2018. Linebacker Malcolm Smith (biceps) missed the entire season, along with 2016 first-round guard Joshua Garnett (knee). Safeties Jaquiski Tartt and Jimmie Ward went down with mid-season broken arms, and 2015 first-round defensive lineman Arik Armstead broke his hand. Receiver Pierre Garcon also was shut down with a neck injury, along with right tackle Trent Brown (shoulder). Healthy returns for those players could provide big boosts next season.

BREAKTHROUGH SEASON: The most impressive free-agent addition last year for the Niners was receiver Marquise Goodwin, who exceeded his four-year output in Buffalo in just one season in San Francisco. Goodwin caught 56 passes for 962 yards and was tied for fifth in catches (29) and sixth in yards receiving (384) in the final five games after Garoppolo took over at quarterback.

For more NFL coverage: http://www.pro32.ap.org and http://www.twitter.com/AP-NFL