LOS ANGELES (AP) The Philadelphia Eagles already knew Nick Foles could do it.

After all, it was only last December when the veteran quarterback replaced an injured Carson Wentz and upset the Los Angeles Rams at the Coliseum. Less than two months after that breakthrough game, he was an improbable Super Bowl MVP.

One season later in the same arena, Foles went back into Wentz's spot under center after three months without game action.

Foles promptly recaptured the magic, passing for 270 yards and confidently leading the Eagles to a 30-23 win over the Rams on Sunday night with plenty of help from his defense and his playmakers.

Foles' encore might not end in the Super Bowl again. It might not even include the playoffs. But after guiding Philadelphia to another win with a grace and poise belying his inactivity, the Eagles are thrilled to have him back in the game.

''It's been really emotional,'' said Foles, who went 24 of 31 with one interception. ''You hate for your teammate to get hurt. I feel really bad for Carson. ... What you've done in the past, what I've done in the past, it doesn't matter when you step on that field. It's a new day. So I was dealing with the emotions, but prepping as hard as I could, and then realizing I'm not alone. I have great teammates out there. All I have to do is spread the ball around, lean on them, stay in the moment, and we were able to do that tonight. Today was a huge win for us.''

Wendell Smallwood rushed for two touchdowns and rookie Josh Adams ran for another score as the Eagles (7-7) kept their playoff hopes quite viable with a gritty victory over the Rams (11-3), who lost consecutive regular-season games for the first time in coach Sean McVay's tenure.

Foles hadn't played since Week 2, but Wentz is out with a back injury that could sideline him for the rest of the season. Philadelphia coach Doug Pederson declined to say whether Foles would start next week against Houston, but Foles' teammates know what they've got after he slipped right back into his old role in a simplified offensive game plan.

''That's a guy with true character,'' Smallwood said of Foles. ''We're just comfortable with him back there. We don't feel like anything has fallen off. We know he's going to step up there and do the job. We rode that guy and we stuck with him (last year), and he went out and played for us tonight.''

The Eagles still trail NFC East leader Dallas (8-6) and sit even with Washington (7-7), so they will need help to get back into the postseason, most likely from Carolina and Minnesota stumbling down the stretch. But they'll get an enormous boost from becoming the first team to beat the Rams twice under McVay.

''It's very satisfying,'' Pederson said. ''Our backs have been against the wall for the last few weeks. Hopefully this gives us momentum for the rest of the season. Our goals are still in front of us.''

The Eagles scored 17 consecutive points in the third quarter and then survived the Rams' late rally. After Philadelphia's Jake Elliott missed a field goal with 1:08 left, Jared Goff got the Rams to the Philadelphia 18 with 4 seconds to play - but he couldn't connect with Josh Reynolds on a pass to the goal line as time expired.

Goff passed for 339 yards with two interceptions in the Rams' first loss at the Coliseum in seven games this season.

Todd Gurley rushed for two touchdowns - giving him an NFL-best 21 TDs this season - while catching 10 passes for 76 yards. But the superstar running back also accepted the blame for failing to get out of bounds on a catch inside the final 20 seconds, depriving the Rams of likely two additional shots at the end zone.

''We have to be able to figure this out and fast,'' McVay said. ''We are doing things that are uncharacteristic of us. Guys are making decisions and mistakes we typically haven't seen.''

The Rams already have won the NFC West title, and they still control their destiny for a first-round playoff bye with Chicago (10-4) right behind them. But Los Angeles also has produced three straight pedestrian performances since that epic 54-51 Monday night win over Kansas City last month and an ensuing bye week.

''It's good to go through some adversity at some point,'' said Goff, who hasn't thrown a TD pass since the first half at Detroit. ''Going through it now, and in the position we are in with the playoffs, we (still) have to be urgent about getting these things fixed. These things are very fixable.''

BIG TARGETS

Foles repeatedly connected with Alshon Jeffery, who had eight catches for 160 yards in the third-biggest game of his career. Zach Ertz had three receptions to become the fourth tight end in NFL history with 100 catches in a season.

INJURIES

Eagles: DT Fletcher Cox went to the locker room on a cart during the first half with a hip injury, but returned to the field before halftime.

Rams: Gurley missed several snaps in the second half with a knee injury, but returned.

UP NEXT

Eagles: Host the Houston Texans on Sunday, Dec. 23. Houston can wrap up the AFC South with a victory.

Rams: Visit the Arizona Cardinals on Sunday, Dec. 23. LA shut out the Cardinals at the Coliseum in September.

---

More AP NFL: https://apnews.com/NFL and https://twitter.com/AP-NFL

Copyright 2018 by AP. Any commercial use or distribution without the express written consent of AP is strictly prohibited.