PHILADELPHIA (AP) Once their defense made one last stop to prevent a collapse, the Philadelphia Eagles became defensive.
But the mood afterward almost seemed like they lost because the Eagles allowed the Rams to rally from a 27-point deficit and drive within 48 yards of the winning score before Austin Davis threw an incomplete pass on fourth-and-13.
''Regardless of how you do it, a win is a win,'' safety Nate Allen said. ''We're going to clean up a lot of things, get better in a lot of areas and keep moving forward.''
The Eagles (4-1) rebounded from a tough loss at San Francisco with a strong all-around performance until the offense stumbled and defense fell apart in the fourth quarter. Chris Maragos returned a blocked punt for a touchdown, Cedric Thornton recovered a fumble for a score and nearly took another one the distance.
''Tough 4-1, soft 4-1, doesn't matter, you're 4-1, and it's the same thing,'' coach Chip Kelly said.
Austin Davis rallied St. Louis (1-3) from a 34-7 deficit with three straight scores, including a 5-yard pass to Brian Quick that cut it to 34-28 with 4:41 left.
The Rams had a chance for the win when they got the ball at their 7 with 1:47 left. Davis threw a 43-yard pass to Quick on first down, but Philadelphia's defense finally held. Davis was under pressure when he threw an incomplete pass on fourth-and-13.
''We were rolling. I had no doubts in my mind we were going to win,'' Davis said of the final drive.
Davis, who began the year as the No. 3 quarterback, finished with 375 yards passing and three TDs in his first game since being elevated to starter for the rest of the season.
The Eagles have scored seven TDs on special teams and defense, becoming the first team since 1970 to have that many in the first five games.
''Turnovers equal victories,'' Thornton said. ''We try to get our hands on the ball and we've been capitalizing on it.''
Here's some things we learned from Philadelphia's win over the Rams:
RESILIENT RAMS: The Rams wouldn't go down easily. Davis brought them back with several big throws, including a 30-yard TD pass to Kenny Britt. His first TD pass was most impressive. Davis scrambled backward, avoided a pass rush and threw from the 25, an 8-yard TD pass to Quick in the back of the end zone.
''It's unfortunate that we ran out of time,'' coach Jeff Fisher said. ''I'm proud of the way the guys just battled and battled. I think everybody on the sideline thought we were going to put the ball in the end zone there at the end and win it.''
PROTECTING FOLES: Despite missing starters Evan Mathis and Jason Kelce, the offensive line didn't allow Foles to be sacked for the third time in five games. Foles has been sacked once in the last four games after going down five times in the season opener.
''I felt very comfortable stepping up and I thought they did a really great job of keeping me clean,'' Foles said.
SHADY'S PROGRESS: LeSean McCoy, an All-Pro last year, had 81 yards rushing on 24 carries. He had 39 yards on 29 carries in the previous two games. The return of right tackle Lane Johnson from suspension helped open a few more holes for McCoy. But he hardly resembles the guy who set a franchise record for yards rushing last year.
''I thought there were a lot more lanes today,'' McCoy said. ''The guys up front did a great job. I think that I have to do a better job of breaking more tackles.''
DROUGHT OVER: Foles tossed a 9-yard pass to Riley Cooper with 30 seconds left in the second quarter, ending a drought of 18 drives and 97:04 without an offensive TD. The Eagles set several team records on offense last year, but have been inconsistent this season. They have 11 offensive touchdowns, only four more than their defense and special teams.
''We have a lot of improving to do,'' Foles said. ''We all know that and that's what really excites us.''
AP NFL websites: www.pro32.ap.org and www.twitter.com/AP-NFL
Follow Rob Maaddi on Twitter: https://twitter.com/AP-RobMaaddi