Jared Goff threw for 333 yards and two touchdowns, Riley Patterson kicked a 41-yard, game-winning field goal as time expired, and the Detroit Lions prevailed in a 41-38 shootout over the Los Angeles Chargers on Sunday.

The Chargers (4-5) tied it at 38-all with 3:34 remaining when Justin Herbert threw his fourth touchdown pass of the day, a 38-yarder to Keenan Allen on fourth-and-1.

Goff responded by leading the Lions (7-2) on a nine-play, 53-yard drive, culminating in Patterson's kick. The key play was Goff's 6-yard completion to rookie tight end Sam LaPorta on fourth-and-2 from the LA 26-yard line.

CLICK HERE FOR MORE SPORTS COVERAGE ON FOXNEWS.COM

Goff, playing in SoFi Stadium for the second time since being traded by the Rams to the Lions in 2021, was 23 of 33.

David Montgomery had 116 yards on 12 carries, including a 75-yard touchdown in the second quarter. Jahmyr Gibbs added 77 yards and two touchdowns for the NFC North-leading Lions.

Amon-Ra St. Brown had a career-high 156 receiving yards on eight catches, including a 20-yard TD to put the Lions ahead 31-24 in the third quarter. He is the first Detroit receiver to have six 100-yard games in a seven-game span since Calvin Johnson in 2012.

Herbert completed 27 of 40 passes for 323 yards with the four TDs and an interception. Allen had 11 catches for 175 yards and two touchdowns, including a 29-yard TD in the second quarter.

Jared Goff and Dan Campbell

Los Angeles Chargers head coach Dan Campbell talks to quarterback Jared Goff (16) during the second half an NFL football game against the Los Angeles Chargers Sunday, Nov. 12, 2023, in Inglewood, Calif.  (AP Photo/Ashley Landis)

The teams traded field goals before a pair of 1-yard TD runs by Gibbs put the Lions up 17-3 midway through the second quarter. His first score was set up by a 35-yard scamper where he went off right end and then made a nice cut before being tackled at the Chargers 1-yard line.

The Chargers got within 24-17 on Austin Ekeler's 2-yard carry with 23 seconds remaining in the first half. After forcing Detroit to punt on the opening series of the second half, Los Angeles tied it for the second time when Herbert threw an 18-yard bullet to Jalen Guyton.

TEXANS' CJ STROUD ORCHESTRATES SECOND STRAIGHT GAME-WINNING DRIVE TO BEAT BENGALS ON ROAD

After that, the game settled into a pattern of Detroit taking the lead and LA rallying to tie it.

Following St. Brown's score, Chargers first-round pick Quentin Johnston scored his first touchdown on a 1-yard reception on fourth-and-goal with 11:30 remaining in the fourth quarter.

Four minutes later, the Lions' Brock Wright was wide open down the middle on a 25-yard TD reception.

HIGHLIGHT RUN

One play after first Allen's TD, Montgomery took a handoff from Goff, went up the middle, caused three Chargers defenders to miss at the Detroit 45, and then made a cut and found a lane up the left sideline to put Detroit ahead 24-10. There was a replay review to determine if Montgomery stepped out at the LA 16, but the play was upheld.

It was the Lions' longest touchdown run since Jahvid Best went 88 yards in 2011. Montgomery is also the first Detroit player to have two rushing TDs of at least 40 yards since Barry Sanders in 1998.

INJURIES

Lions: WR Donovan Peoples-Jones, acquired in a trade with Cleveland on Oct. 31, was inactive.

Chargers: LB Chris Rumph II injured his foot during pregame warm-ups and did not play. ... LB Kenneth Murray Jr. (shoulder) and TE Gerald Everett (back) were injured during the third quarter.

CLICK HERE TO GET THE FOX NEWS APP

UP NEXT

Lions: Host Chicago next Sunday.

Chargers: At Green Bay next Sunday.