DETROIT (AP) -- Matt Prater kicked a 29-yard field goal with 1:28 left and Darius Slay made an over-the-shoulder interception on the next snap, helping the Detroit Lions hand Carson Wentz his first loss with a 24-23 victory over the Philadelphia Eagles on Sunday.
The Lions (2-3) had lost three straight.
"It's a big one," Matthew Stafford said after throwing three touchdown passes. "But at the same time, we've got to stack these."
The Eagles (3-1) turned the ball over for the first time this season with 2:34 remaining when Ryan Mathews fumbled on a hit by Slay. The loose football was recovered by Tyrunn Walker at the Philadelphia 45.
"I cannot let that happen," Mathews said. "That's all on me after the way we played today. I know there isn't anything I can do to fix it, and I have to move forward, but this one hurts."
Stafford set up the game-winning kick by converting a third-and-4 from the Eagles 39 with a perfectly placed pass on a crossing route to Golden Tate, who drew an unnecessary roughness penalty on Malcolm Jenkins.
"I needed that," Tate said. "This team needed that."
Tate, who was held to only one catch in last week's loss at Chicago, had three receptions for 39 yards. The veteran receiver also helped out Detroit's depleted backfield by lining up as a running back for three carries that gained 6 yards and as a decoy to help set up Stafford's 17-yard TD pass to Theo Riddick.
Philadelphia had the ball at its 25 with 1:28 remaining and no timeouts left. Wentz, who did not turn the ball over in his first three games, attempted a long pass to Nelson Agholor on first down and Slay made the game-sealing interception at the Detroit 23.
Wentz, the No. 2 pick overall in the draft, was 25 of 33 for 238 yards with a pair of 1-yard TD passes to Ryan Mathews and Josh Huff.
"I didn't buy the hype before today, but he's is the real deal," Slay said. "He doesn't play like a rookie."
Even though Wentz's last pass looked like a desperation heave, Eagles coach Doug Pederson didn't mind his decision to go deep.
"It's not necessarily designed for that, but the opportunity was there," Pederson said.
The Lions scored on all three of their drives in the first half, building a 21-7 lead late in the second quarter.
Stafford threw two TD passes to Riddick in the first quarter and another to Marvin Jones in the second. The Eagles hadn't given up a passing TD, a point in the first quarter or allowed offenses to combine to score three TDs through three games.
Eagles defensive coordinator Jim Schwartz, who led the Lions from 2009 to 2013, seemed to make some adjustments.
The Lions gained just 19 yards on the first four possessions, fumbling once and punting three times.
Philadelphia, meanwhile, opened the second half with Wentz capping a nine-play, 75-yard drive with a 1-yard TD pass to Huff.
Stafford's unforced fumble on the ensuing drive was recovered by Nigel Bradham, who was arrested last Sunday on a misdemeanor concealed weapons charge, at the Lions 16.
The Lions held Philadelphia to a field goal, allowing them to cling to a 21-20 lead.
Caleb Sturgis' 49-yard field goal, his third, put the Eagles ahead for the first time with 6:45 left, but they couldn't hold on.
INJURIES: Eagles CB Leodis McKelvin returned after missing the last two games with a hamstring injury, aggravated it, but was cleared to return in the fourth quarter. ... Lions DT Haloti Ngata left the game with a shoulder injury.
UP NEXT: The Eagles play at Washington Sunday. The Lions host Los Angeles on Sunday.