In need of a big play on defense, Darius Slay delivered – twice.

Slay forced a Ryan Mathews fumble with just under three minutes to play to set up Matt Prater’s game-winning field goal then intercepted a Carson Wentz pass with 1:17 left as the Detroit Lions snapped a three-game losing streak with a 24-23 victory over the Philadelphia Eagles at Ford Field.

The Lions scored touchdowns on their first three offensive possessions, but needed Slay’s late-game heroics after their offense stalled out in the second half.

The Eagles led 23-21 and were a first down away from running out the clock when Slay hit Mathews hard on a pitch play to knock the ball loose.

The Lions recovered and took possession at the Eagles’ 45-yard line, and Matthew Stafford hit forgotten man Golden Tate with a big third-down conversion three plays before Prater made a 29-yarder.

The Eagles, who had no turnovers in their first three games, started their final drive at their own 25 with 1:28 on the clock, but Went threw his first interception of the year on the first play from scrimmage.

The Lions (2-3) had just one takeaway in their first four games and struggled defensively much of Sunday playing without Ziggy Ansah and DeAndre Levy.

Slay, who was rarely challenged in the game, signed a four-year, $51 million contract extension before the season but had just four career interceptions entering Sunday.

Stafford threw touchdown passes on all three of the Lions’ first-half possessions, leading drives of 75, 80 and 75 yards as the Lions took a 21-10 lead into halftime.

Theo Riddick caught a 1-yard touchdown pass to open the scoring two plays after Stafford converted a third-and-11 with a 20-yard pass to Anquan Boldin.

Riddick scored again on the Lions’ next possession, catching a 17-yard pass on a misdirection play with Golden Tate lined up as a running back.

The Eagles answered with a 1-yard touchdown pass from Carson Wentz to Ryan Mathews to make it 14-7, before Stafford hit Marvin Jones with a 1-yard touchdown pass with 3:08 left in the second quarter.

Stafford completed 19 of 25 passes for 180 yards and had one fumble.

Tate, who was benched for most of the second half of last week’s loss to the Chicago Bears, had just three catches for 39 yards but the Lions’ most important offensive play.

Had the Lions not converted that third down, Prater likely would have come on to attempt a 58-yard go-ahead field goal.

Wentz finished 25 of 33 passing for 238 yards and two touchdowns for the Eagles.