PHILADELPHIA -- Jamal Agnew quickly made up for two fumbles and the defense stepped up for Detroit when special teams almost blew it.
"It's good to get wins not playing your best football," Stafford said. "We're not playing our best, we kept battling. Finding ways to win as you're getting better as a team is a good thing."
The Eagles had a chance after Malcolm Jenkins blocked Matt Prater's 46-yard field goal try with 1:53 left. Rasul Douglas returned it to the Lions 22, but an illegal block on Jenkins pushed it back to midfield.
On fourth-and-5, Darren Sproles caught a pass for a first down but got called for Philadelphia's third offensive pass interference. Wentz's deep pass to J.J. Arcega-Whiteside fell incomplete with 41 seconds left. The rookie receiver said he should've caught it.
"It's the moment you ask for and dream about," Arcega-Whiteside said. "I gotta make the play."
The Lions (2-0-1) remain undefeated and the Eagles (1-2) have lost two in a row.
Agnew got Detroit started by going the distance after Philadelphia jumped ahead 3-0. He atoned for mistakes in the first two games.
"I owe it to my teammates and the coaching staff for sticking with me," he said.
Lions coach Matt Patricia sensed Agnew would breakout.
"He was working and he was grinding," Patricia said. "Give him all the credit in the world."
Jones had six catches for 116 yards, including a 12-yard TD reception that extended Detroit's lead to 27-17 on the first play of the fourth quarter.
The Eagles' injury-depleted offense missing its top two receivers was sloppy.
"Can't make excuses," Agholor said. "We had opportunities. We have to make plays."
The Eagles cut it to 27-24 when Wentz threw a 2-yard TD pass to Agholor with 6:59 left. Penalties cost the Lions on that drive. A late hit on Wentz against Trey Flowers extended it and an unnecessary roughness call on Jarrad Davis moved the ball to the 5.
Wentz threw a 20-yard TD pass to Agholor in the third quarter. But the Lions answered with Stafford's TD to Jones.
Kerryon Johnson's 1-yard TD run gave the Lions a 14-10 lead early in the second quarter.
Sanders fumbled twice on one drive and Detroit recovered his second one. That led to Prater's 25-yard field goal and a 17-10 lead.
Jordan Howard ran in from the 1 after Wentz scrambled 19 yards on third-and-6, giving the Eagles a 10-7 lead in the first quarter.
Agnew had the first kickoff return for a score this season. There were five in the NFL last year.
Patricia was on the other sideline as New England's defensive coordinator when Nick Foles led the Eagles to a 41-33 win over the Patriots in the Super Bowl two seasons ago.
Stafford now is 2-1 against Jim Schwartz, the Eagles defensive coordinator who was a first-year head coach when Detroit drafted the quarterback No. 1 overall in 2009.
Sanders had his helmet ripped off on a kickoff return when he was clotheslined by Miles Killebrew, who also grabbed the facemask and spun it around. There was no penalty called. The blatant miss was nearly as obvious as the non-call on the pass interference in the Rams-Saints NFC championship game. Todd Prukop was the back judge for both games.
The Eagles scored 10 points in the first quarter after scoring only 20 points combined in the previous 12 first quarters.
Lions: DT Mike Daniels (foot) left in the first quarter and didn't return and Slay (hamstring) exited in the third quarter.
Lions: Host Kansas City next Sunday. The Chiefs won the previous matchup 45-10 on Nov. 1, 2015, but the Lions have won the past two times at home.
Eagles: At Green Bay on Thursday night. The Packers have won five of the past six meetings, including a 53-20 rout at Lambeau Field on Nov. 16, 2014.
More AP NFL: https://apnews.com/NFL and https://twitter.com/AP-NFL
Source: Chiefs get 'best-case scenario' on MRI results for Patrick Mahomes
While the medical evaluation of Chiefs QB Patrick Mahomes is still ongoing, the team received "a best-case scenario" after the results of the MRI was "good," a source told ESPN.
Patrick Mahomes dominoes: Barnwell on the Chiefs' options, AFC playoff picture
The star quarterback will miss weeks with a dislocated kneecap. Is Kansas City doomed? Which QBs could it add? Bill Barnwell weighs the options.
Chiefs coach Andy Reid on his 200th win: 'I'm old'
Reid moved into a tie for sixth place on the all-time NFL coaching wins list Thursday night.
Bengals suspend OT Cordy Glenn for disciplinary reasons
Bengals lineman Cordy Glenn, who missed practice Thursday because of an internal discipline issue, has been suspended by the team for Sunday's game vs. Jacksonville.
Stephen A.: Cowboys have 'nothing to lose' in Brown signing
Stephen A. Smith considers the Cowboys a desperate team and says Dallas has "nothing to lose" by signing Antonio Brown.
Berry loves Coleman this week
Matthew Berry predicts Tevin Coleman will have a productive day in the 49ers run-heavy offense against the Redskins.