LAS VEGAS (AP)In his first NFL start, Jarrett Stidham threw for 365 yards and three touchdowns against the NFL’s top defense – and apologized to his teammates after the game.

Stidham, named the Raiders’ starter Wednesday after nine-year veteran Derek Carr was benched, did just about everything he could for Las Vegas against the San Francisco 49ers on Sunday.

He finished 23 of 34 passing but threw two interceptions, including a pick in overtime that set up Robbie Gould’s short field goal and gave the 49ers a 37-34 victory that eliminated the Raiders from playoff contention.

”He apologized … and I think every single person on the team said, `Man, get out of here with that. You balled out and you did your thing,”’ said Davante Adams, who finished with seven catches for 153 yards and two touchdowns. ”We got to find a way to help him, protect a little longer, catch a few more balls and get a couple more first downs. A few more points and it could have been a dream situation for him.”

Instead, the dream turned into a nightmare when the Raiders did what they’ve done too many times this season – blow a double-digit lead in the second half. It was an NFL-record fifth time the Raiders squandered a second-half lead of 10 points or more.

The 49ers rallied from a 24-14 deficit early in the third quarter to take a 27-24 lead, setting up a back-and-forth finish against their former Bay Area neighbors in the teams’ first meeting since the Raiders moved to Las Vegas.

Stidham, who became the second quarterback since 1950 with at least 350 passing yards and three touchdown passes in his first career start, looked poised in leading the Raiders to scores on four of their first five drives.

Adams said he wasn’t surprised.

”I know the way he prepares,” said Adams, who topped 100 yards receiving for the eighth time, the most in a single season in Raiders history. ”He prepared every single week like he was getting ready to play and it showed.”

Nevertheless, the fourth-year QB took ownership of his mistakes, including Tashaun Gipson’s interception that was returned inside the Raiders 10-yard line and put San Francisco in position for Gould’s chip-shot game-winner.

”The ball is in my hands every play,” Stidham said. ”I’m the only one that gets to touch it every play. Unfortunately, there was two interceptions in the game, and probably some things that I definitely could have done better to win. Obviously, we’re going to look at the film tomorrow morning and see what I could have done better.”

The Raiders finish their season at home against Kansas City before heading into an offseason when they’ll have to decide their future at quarterback. The team has until Feb. 15 to release or trade Carr before he gets a guaranteed $33 million for 2023.

Stidham made the case that the Raiders may not have to look far for their next QB.

”I thought Jarrett put in a great week of work, obviously he knows what to do, he’s been in our system a long time and has the grasp of it, understands what to do,” coach Josh McDaniels said. ”I thought he executed a lot of things the right way today, gave our guys a chance to make some plays. … I thought leading our team, his energy, his communication, I thought we had good rhythm. It didn’t surprise me that he was ready to go and played the way that he played.”

AP NFL: https://apnews.com/hub/nfl and https://twitter.com/AP-NFL