Jimmy Garoppolo's stretch of avoiding the catastrophic mistakes that have plagued him throughout his career came to a crushing end.

Garoppolo threw a pair of interceptions to turn a game that San Francisco seemed to have under control into a 20-17 loss to the Tennessee Titans on Thursday night.

“It’s a tough one, but got to take your lumps and move on from it,” Garoppolo said. “We just didn’t do enough tonight.”

San Francisco 49ers wide receiver Brandon Aiyuk catches a touchdown pass as he is alone in the end zone in the second half of an NFL football game against the Tennessee Titans Thursday, Dec. 23, 2021, in Nashville, Tenn. (AP PhotoMark Zaleski)

San Francisco 49ers wide receiver Brandon Aiyuk catches a touchdown pass as he is alone in the end zone in the second half of an NFL football game against the Tennessee Titans Thursday, Dec. 23, 2021, in Nashville, Tenn. (AP PhotoMark Zaleski)

After an impressive touchdown drive to open the game for the 49ers (8-7), Garoppolo threw an interception in the end zone and then missed another potential touchdown on the third drive when he couldn't connect on a deep strike to a wide-open Kyle Juszczyk.

That helped keep the Titans in the game long enough for their second-half comeback as the Niners lost for the first time ever under coach Kyle Shanahan when leading by at least 10 points at the half.

“I thought we should’ve been up more, that was for sure,” Shanahan said. “I thought we could have got three scores with those drives. We didn’t.”

Garoppolo was a big reason why. He had more trouble in the second half, throwing another interception on the first drive of the third quarter to set up a tying TD and then missing Brandon Aiyuk on a fourth-and-6 on the next drive.

Garoppolo did lead a game-tying drive late in the fourth quarter and throw for 322 yards. But he showed the deficiencies that led San Francisco to trade three first-round picks to draft his eventual replacement Trey Lance last spring.

But Garoppolo has remained the starter this season in part because of the recent eight-game stretch when he mostly eliminated his mistakes to get the Niners into playoff position.

Now instead of building a little cushion, they slipped up in a game they were in position to win.

“We had a chance,” Garoppolo said. “In a game like that you just got off to a hot start like that and we were rolling early on and kind of just got a little sluggish in the middle there. ... It’s tough when you let a win like this slip away.”

WHAT’S WORKING

Long drives. The Niners offense didn't do much between the first three drives and when San Francisco took over at its 5 trailing by seven points with 5:18 to go. The 49ers managed to move 95 yards in eight plays to tie the game on a 2-yard TD pass from Garoppolo to Brandon Aiyuk. That was San Francisco's league-leading sixth TD drive of at least 90 yards this season.

WHAT NEEDS HELP

Third-down defense. The Niners allowed the Titans to convert 9 of 16 third downs, including six plays when they needed at least 10 yards. Tennessee had three conversions of third-and-7 or longer on its first scoring drive in the third quarter and averaged 9.0 yards per play on third down.

STOCK UP

Deebo Samuel. The Niners' do-everything star had nine catches for 159 yards and ran five times for 32 for his fourth game this season with at least 150 yards from scrimmage. The only other San Francisco receiver to do that was Jerry Rice in 1994 and '95. Samuel’s fifth catch for at least 50 yards — matching the league high — set up the game-tying touchdown, and he now has 1,548 yards from scrimmage and 12 TDs on the season.

STOCK DOWN

Garoppolo. The Niners fell to 1-6 this season when Garoppolo throws at least one interception compared to 7-0 when he doesn't. But the bigger issue Thursday might have been Garoppolo's inability to get the ball downfield. He was 20 for 22 for 186 yards and a TD on throws 5 yards or less downfield, compared to 6 for 13 for 136 yards and two interceptions on throws more than 5 yards downfield, according to Sportradar.

INJURIES

LB Azeez Al-Shaair (knee) left the game and will undergo an MRI. ... RB Elijah Mitchell (knee) missed his third straight game but could return next weekend.

KEY NUMBER

6. The six conversions allowed when the Titans needed at least 10 yards on third down were tied for the most in a game since at least 2000. Only six teams had allowed six in that span, with the last coming Sept. 30, 2018, when the Colts converted six against the Texans.

NEXT STEPS

The 49ers host Houston on Jan. 2

More AP NFL coverage: https://apnews.com/hub/nfl and https://twitter.com/AP_NFL