DETROIT - Dre Greenlaw returned an interception for a touchdown to help the San Francisco 49ers score 17 points over two-plus minutes late in the first half, and they barely held on for a 41-33 win over the Detroit Lions on Sunday.
San Francisco led 38-10 early in the fourth quarter and allowed Detroit to score 23 points in three-plus minutes to pull within eight points. But the Lions turned the ball over on downs at the San Francisco 24 with 12 seconds left after getting it back on a fumble by Deebo Samuel.
For most of the afternoon, the 49ers performed more like the Super Bowl-contending team they were two years ago than the 10-loss squad they had last season when injuries took a major toll.
Meanwhile, it looked like the many changes the Lions made might be moot in coach Dan Campbell's debut — until the comeback provided some hope.
San Francisco welcomed back Jimmy Garoppolo and George Kittle on offense and Nick Bosa on defense after each missed much of last season with injuries.
Garoppolo, who helped San Francisco win the 2019 NFC championship, is 23-8 in the regular season since being acquired from New England. Kittle had four receptions for 78 yards. Bosa had four tackles, including a drive-ending sack early in the fourth quarter.
Garoppolo, who lost a fumble on his first snap, was 17 of 25 for 314 yards. He threw a 79-yard touchdown pass to Samuel, who took advantage of cornerback Jeff Okudah falling. That gave the Niners a 28-point cushion midway through the third quarter. They needed it.
Samuel had nine catches for a career-high 189 yards. Rookie Elijah Miller, filling in for injured Raheem Mostert, had a tiebreaking, 38-yard touchdown run early in the second quarter and finished with 104 yards rushing.
In his Detroit debut, Jared Goff was 38 of 57 for 338 three touchdowns and a costly interception. T.J. Hockenson had a career-high eight receptions for 97 yards and scored in the season-opening game for the third time in three years.
Goff, the former Los Angeles Rams quarterback acquired along with first-round draft picks for Matthew Stafford, was picked off late in the second quarter by Greenlaw. The linebacker returned the interception 39 yards to give San Francisco a 28-10 lead.
The Niners led 31-10 at halftime, their highest total after two quarters since 2008.
San Francisco quarterback Trey Lance connected with receiver Trent Sherfield on a 5-yard, play-action pass to help the 49ers take a 7-0 lead late in the first quarter.
The former North Dakota State star is the first rookie to throw a touchdown on his first pass attempt since Atlanta's Matt Ryan against Detroit in 2008. Lance also became the first Niners rookie to throw for a score in a season-opening game since they joined the NFL in 1950.
49ers: Mostert (knee), Greenlaw (groin) and CB Jason Verrett (right leg) were hurt.
Lions: WR Kalif Raymond limped off the field, favoring his left leg in the third quarter. On a play in the fourth quarter, both Okudah (foot) and DT Kevin Strong were injured.
49ers: at Philadelphia on Sept. 19.
Lions: at Green Bay on Sept. 20.