SANTA CLARA, Calif. (AP)After the shock of losing starting quarterback Trey Lance to a season-ending injury wore off, the San Francisco 49ers looked awfully familiar with Jimmy Garoppolo back at quarterback.

Garoppolo threw a touchdown pass on his first full drive after replacing Lance and ran for another score to help the San Francisco 49ers beat the Seattle Seahawks 27-7 on Sunday.

”Just like riding a bike,” Garoppolo said. ”It felt good to be back out there. Feel terrible for Trey. I’ve been on that side of it. This league is tough. That sucks for him.”

Lance broke his right ankle on the second drive of the game, a season-ending injury for the 22-year-old who was given the keys to San Francisco’s offense this season. He was taken off the field on a cart, his injured ankle in an air cast.

Coach Kyle Shanahan said after the game that Lance would need surgery and will miss the rest of the season.

”It’s tough,” Shanahan said. ”You feel for someone so bad. It’s a sad moment. But you don’t have time to sit there and think about it. You have to get right back to the game. Guys did a good job of that.”

That set the stage for Garoppolo to come in and reclaim the job he held for most of the past four seasons as the surprising decision to keep Garoppolo on a reduced contract paid nearly immediate dividends for the Niners.

He completed his first five passes in his first game since last season’s NFC title game, including a 38-yard touchdown pass to Ross Dwelley that put San Francisco (1-1) up 13-0.

”I thought Jimmy looked great and it felt like Niners football,” fullback Kyle Juszczyk said. ”We’ve been doing this thing for five years. Jimmy’s been around for a long time. I mean, props to him for just being such a professional and being ready to go.”

The Niners mostly coasted from there as the Seahawks (1-1) looked rather flat six days after their emotional, season-opening victory over former quarterback Russell Wilson and the Broncos.

Geno Smith went 24 for 30 for 198 yards and an interception. Seattle also had a trick play near the goal line backfire for another turnover and rushed for only 35 yards on the day.

”Quite a distance from one week to the next,” coach Pete Carroll. ”This league just reminds you how you get humbled. We didn’t do anything like we wanted to today at the line of scrimmage, on either side of the ball.”

Lance took over the starting job this season from Garoppolo after being drafted third overall in 2021. San Francisco traded three first-round picks to move up nine spots to take Lance, making a major investment in him.

Lance spent his rookie season mostly on the bench watching Garoppolo as the Niners went all the way to the NFC title game before losing to the Rams.

San Francisco planned to trade Garoppolo this offseason but was unable to after he underwent shoulder surgery in March.

Garoppolo remained on the roster but didn’t practice with the team at all during training camp, throwing on his own on a side field, before agreeing to return as a backup on a reduced contract.

”I’m comfortable here,” Garoppolo said. ”The players, the scheme, all that stuff, the locker room. It’s comfortable. I’m familiar with it. I’m not saying I knew this was going to happen, but I was ready for this in case it did happen.”

Garoppolo went 13 for 21 for 154 yards and the TD. He iced the game with a 1-yard sneak late in the fourth quarter.

BLOCKED

The Seahawks got on the board in the third quarter thanks to their special teams. Tariq Woolen blocked a 20-yard field goal attempt by Robbie Gould, and Michael Jackson scooped it up and ran 86 yards for the score.

VERSATILITY

Dwelley had a big day on offense and special teams. Along with the TD catch from Garoppolo, Dwelly also recovered a muffed punt after Tarvarius Moore pushed blocker Xavier Crawford into returner Tyler Lockett.

Dwelley was the first player in the NFL to catch a TD pass and recover a fumble by the opponent in the same game since teammate Kyle Juszczyk did it against Atlanta on Dec. 15, 2019.

That recovery set up Juszczyk’s 1-yard run that it 20-0 at the half.

TRICKED UP

The Seahawks called for a trick play in the second quarter that they immediately regretted. DeeJay Dallas took a handoff following a direct snap to Kenneth Walker III and tried to force a pass into the end zone to DK Metcalf. Charvarius Ward was right there for his first interception for San Francisco.

INJURIES

Seahawks: DL Shelby Harris (glute) left the game in the first half and didn’t return. … G Damien Lewis (thigh) also got hurt and didn’t return.

49ers: TE Tyler Kroft (knee) left the game in the second half and didn’t return.

UP NEXT

Seahawks: Host Atlanta on Sunday.

49ers: Visit Denver on Sunday night.

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