There will be another week of meaningful football in Philadelphia.

That outcome appeared at risk Sunday when the Eagles surrendered a 13-point lead late in the fourth quarter to the Houston Texans, and when Nick Foles sprawled in pain on the Lincoln Financial Field turf a few minutes later, and before Jake Elliott kicked a 35-yard field goal with three seconds remaining.

But their heart keeps beating after a 32-30 win after a dramatic fourth quarter. The Eagles lost a comfortable lead, yet Foles led the Eagles on a game-winning drive even after a painful hit to his ribs. Elliott kept the season alive by putting the Eagles ahead when the clock expired.

“That fourth quarter, the circumstances, has kind of been the epitome of our season,” tight end Zach Ertz said. “We did not blink.”

It pushed the Eagles to 8-7 entering next Sunday’s season finale at Washington. The Eagles must win that game and they need either Minnesota to lose to Chicago or Seattle to lose its final two games. (The Seahawks played Sunday night against Kansas City.) So the Eagles’ postseason hopes are not entirely within their control, but it’s a plausible scenario for a team that fell to 4-6 last month and has won five of its last six games.

“We need to find a way to a win a game – that’s all we can control, that’s the only thing within our grasp, that’s all we need,” safety Malcolm Jenkins said. “The rest will handle itself. … Nothing you can do but win your game. And we did that.”

They’re here in large part because of Foles, who has stepped in for the injured Carson Wentz and played like the Super Bowl MVP he was. Foles finished 35 of 49 for a franchise-record 471 yards and four touchdowns. He also had an interception and a fumble. It might have been Foles’ final Eagles home game, a possibility that left him emotional.

“I love playing in Philly,” Foles said. “I knew there was a chance this could be it. I don’t think about the future, but I am aware of that. Because this city means a lot to me. This team means a lot to me. Wearing that jersey means a lot to me.”

» BIG DAY: Zach Ertz breaks Jason Witten’s single-season catch record for TEs

Foles’ top target was Ertz, who had 12 catches for 110 yards and two touchdowns and broke Jason Witten’s single-season record for receptions by a tight end. Nelson Agholor added five catches for 116 yards and a score.

Texans quarterback Deshaun Watson also starred, passing for 339 yards and two touchdowns and rushing for 49 yards and two scores.

The Eagles broke a 16-16 tie in the third quarter when Foles audibled at the line of scrimmage based on the Texans’ coverage and threw deep to Agholor for an 83-yard touchdown – the longest play of the Eagles’ season.

“I missed the end zone,” said Agholor, who had not scored since Week 2.

Nick Foles lobs the ball to Nelson Agholor (left).
YONG KIM / Staff Photographer
Nick Foles lobs the ball to Nelson Agholor (left).
Nelson Agholor grabs a pass in front of Texans safety Tyrann Mathieu during the third quarter.
TIM TAI
Nelson Agholor grabs a pass in front of Texans safety Tyrann Mathieu during the third quarter.

On the next drive, Chris Long sacked Watson and forced a fumble that Fletcher Cox recovered. When Foles responded with a 23-yard touchdown pass to Ertz, it looked as if the Eagles would win. Even though Elliott missed the extra point, the Eagles still had a two-score lead.

But the Eagles have shown this season that no lead is safe. And Elliott’s miss proved costly.

The trouble started when Josh Adams fumbled around midfield with 5 minutes 21 seconds remaining. Watson needed only 40 seconds to lead the Texans to a touchdown, cutting the Eagles’ lead to six points.

The Eagles took possession with 4 minutes 34 seconds on the clock, and a few first downs might have ended the game. Instead, they were off the field after three plays. Houston took over with just more than four minutes left and a chance to take the lead.

Watson had caused fits for the Eagles all afternoon, and it was apparent on a third-and-11 when three pass rushers failed to drag him to the ground. He kept the play alive and fired a 22-yard pass for the first down.

Three plays later, on another third-and-11, Watson hit Vyncint Smith in the back of the end zone for a 35-yard touchdown. The Texans made the extra point to go ahead, and there were reminders of the Eagles’ losses to Tennessee and Carolina when they lost double-digit leads in the fourth quarter.

That was not on coach Doug Pederson’s mind.

“We have time and timeouts,” Pederson said. “Have a lot of confidence in the offense. Something that we work on a lot is the two-minute drive and tempo offense, and this league has always been about players making plays.”

The drive started at the 11-yard line with two minutes remaining. Players described the huddle as calm and confident. The same was true on the sideline.

“It’s Christmas. It’s St Nick,” Long said. “You know [Foles] is going to put together a drive.”

» GRADING THE EAGLES: Nick Foles, pass offense earn 'A'

After two incompletions, Foles stood strong in pocket when Jadeveon Clowney rushed toward him. Foles lofted a 19-yard completion to Alshon Jeffery for the first down, but he didn’t stand after the play.

“I thought they were going to bury him next to the statue outside,” Long joked.

A flag was thrown on Clowney, who was not penalized earlier in the game when he ripped Foles down by the helmet on a two-point conversion. But the 15 yards paled at the moment compared with the health of Foles. After a few minutes of evaluation, Foles climbed to his feet and jogged to the sideline. Fans chanted his name. He missed only one play.

“Once I was able to move around a little bit, I felt really good and was excited to get back out there with the guys,” said Foles, who added that his ribs were a little sore but that he’ll be healthy enough to play next week.

On a third-and-10 from the Eagles’ 45, Foles connected with Ertz for a 20-yard gain that brought the Eagles into Texans territory. Two defenders collided, allowing Ertz to run free, and Foles made sure to put air under the ball so Ertz could adjust to it. Two plays later, Sproles rushed for 16 yards to make it a high-percentage field goal. Elliott came through for his second game-winning field goal of the season and redeemed himself for the missed extra point.

“I kind of have a little one-minute rule in my head,” Elliott said. “If I make a kick I get one minute to enjoy it, if I miss a kick I have one minute to think about it, correct it. It’s a next-kick mentality a time.”

He’ll have more time to enjoy this kick before the Eagles get ready for what truly is a must-win game next weekend.

The Eagles lost this type of game in October. They were close to buried in November. But it’s Week 17 and they have a chance.

“If you get a chance to go to the playoffs, you need to be playing your best football now,” Pederson said. “I think that’s what we’re doing.”

Get insights on the Eagles delivered straight to your inbox with Early Birds, beat writer Zach Berman’s newsletter for Eagles fans. Click here to sign up.