SAN FRANCISCO _ Brian Hoyer started the night with an interception and ended it on his back _ sacked by Aaron Donald to end the 49ers' last gasp.
In between, it was a night of frantic scoring, crazy comebacks and mounting injuries. It all added up to a 41-39 loss in a prime time game at Levi's Stadium, sending the 49ers to an 0-3 start.
Till the end, the 49ers had a chance. Despite trailing 41-26 with 8:43 to play in the third quarter, Hoyer and the relentless running of Carlos Hyde kept San Francisco within reach.
When the 49ers recovered an onside kick with 2:10 to play in regulation, they looked poised to cap the comeback with a field goal. Instead, the offense went backward. It ended with Donald's sack of Hoyer on fourth-and-20.
This one was a blow. Even in the worst of times, the 49ers always had the Rams to kick around _ including two victories last season.
This time, quarterback Jared Goff threw for 292 yards and three touchdowns, running back Todd Gurley ran 28 times for 113 yards and two scores, and a fleet of Rams receivers gashed the 49ers injury-depleted secondary.
The 49ers actually scored a few touchdowns in this time after failing to do so in their first two games. That was small consolation on this night, when boos were part of the evening's soundtrack. This was hardly the start new coach Kyle Shanahan envisioned.
Worse, an already thin defensive backfield lost another key player. Strong safety Jaquiski Tartt suffered a concussion with 2:04 to play in the third quarter and was taken directly to the locker room for evaluation.
Defensive lineman Tank Carradine (ankle), fullback Kyle Juszczyk (neck) and linebacker Brock Coyle (concussion) also left the game with injuries in the second half.
Tartt was the most notable departure. He was starting in the place of Eric Reid (knee), who is expected to miss multiple games.
Goff, the former Cal star, took advantage with help from Robert Woods (six catches for 108 yards) and Sammy Watkins (six catches, 106 yards and two touchdowns).