For more than three quarters, the Lions looked down and out and headed to their fourth straight loss and a 1-4 start.
Quarterback Matthew Stafford was playing like anything but the face of a franchise, misfiring on passes and unable to sustain drives with any third-down conversions.
The Lions were sloppy and undisciplined, leading to 16 penalties, the most by any team in the NFL this season.
But the team's much-maligned defense, bolstered by the return of safety Louis Delmas, kept them close enough until Stafford, Calvin Johnson and the offense finally came to life.
Jason Hanson kicked a 19-yard field goal to tie the score with three seconds remaining in regulation and then added a 45-yarder to win it in the overtime.
"This team's resilient," Lions coach Jim Schwartz said during a postgame radio interview. "We had to battle through some stuff. We didn't play our best, but we played together.
"This was probably our best game playing together as a team. Defense gave up a play, offense came back and got it back. Offense needed a stop, the defense kept getting them. And special teams ended up winning the game."
The Lions' defensive line has been criticized and called overrated for its failure to live up to expectations, but it was a different story in this one at Lincoln Financial Field in Philadelphia.
The front four was constantly harassing Philadelphia quarterback Michael Vick. Two sacks totaling 21 yards in overtime turned the field position in the Lions' favor and set up the winning field goal.
Both of Detroit's two victories this season have come when Stafford woke up in the final quarter from a mediocre performance.
Tight end Tony Scheffler, who hadn't been producing much early in the season, came through with some big plays during the comeback. And then there was Johnson, who made a spectacular catch along the sideline that put the Lions in field-goal range late in regulation.
The play was initially ruled incomplete, but it got reversed by video replay, which showed that Johnson was able to drag his toes inbounds.
"He's got toes that are a foot long," Schwartz said "I know he's going to be able to get it down."
Stafford completed only six of 18 in the first half for 91 yards and one interception. His quarterback rating at the half was a ridiculously low 27.8.
It didn't get much better in the third quarter when the Lions went three-and-out on both possessions.
Something, however, seems to change for Stafford and the Lions in the fourth quarter.
The Lions had two field goals and no touchdowns through first three quarters. They then scored 17 points in the final 11 minutes.
Detroit has scored more points in the fourth quarter of its five games (73) than in the first three quarters combined (50).
"They're a tough defense," Schwartz said of the Eagles, who led 16-6 with 13:39 remaining and 23-13 with 5:18 to go. "They're top-10 in just about everything. They're a really good third-down team. That's a tough front four.
"We were going to have to battle and earn everything. He (Stafford) stuck with it. He never got down."
Stafford led the Lions back from a fourth-quarter deficit in their opening game against St. Louis, throwing the winning touchdown pass to Kevin Smith with 10 seconds left.
That set a franchise-record for Stafford with his third game-winning TD pass in the final minute of a game.
This time, the Lions settled for field goals to finish off the comeback, but it was just as special and even more meaningful.
Another loss might have put them in a hole too deep to realistically make a playoff run. Now they've got a chance.
Their confidence has soared and they're back in contention with a 2-3 record heading into next week's Monday Night match-up at Chicago.
Delmas, making his first appearance of the season after undergoing knee surgery in early August, had one of the Lions' two interceptions. Believe it or not, they were the team's first two picks of the season.
… Hanson made all four field-goal attempts and is 16-of-17 for the season.
… They're only five games in, but the Lions have already gone to overtime twice. They lost the first one at Tennessee.
… For the fourth straight game, Stafford and company failed to score a first-half touchdown.
… Smith, who opened the season as the starting running back, continues to get phased out. He was inactive despite being healthy. Joique Bell has emerged as the No. 2 running back behind Mikel Leshoure. Smith, who doesn't play on special teams, has become the odd-man out.