LOS ANGELES -- He went in to play for one team that gave up on him against another team that gave up on him.
Such is life in the NFL for a backup quarterback.
Complete coverage of the Philadelphia Eagles and their NFL rivals from NBC Sports Philadelphia.
Nick Foles, now 28 years old and in his sixth NFL season, relieved an injured Carson Wentz Sunday night at the start of the fourth quarter and engineered two field goal drives as the Eagles rallied past the Rams, 43-35, at L.A. Memorial Coliseum (see breakdown).
"He was unbelievable," tight end Trey Burton said. "He stepped in there and led us and took us where we needed to be.
"He's an unbelievable quarterback. A lot of people sometimes might forget about that, but he's won a lot of games and he's set a lot of records."
Although there was no word from the Eagles, team officials believe Wentz has a torn anterior cruciate ligament in his left knee, which would presumably end his season.
If that's the case, the 11-2 Eagles would go into the playoffs with Foles at quarterback.
"I'm absolutely ready," Foles said. "That's why I'm here. I'm ready to go. Prepare every day, work every day, ready to go if need be. That's my job. That's why they brought me here."
Foles didn't exactly light up the Rams, but also, in his first extended playing time in more than 13 months, he didn't make any mistakes and made a few big throws under pressure.
He entered the game with the Eagles trailing 35-31 at the start of the fourth quarter and engineered two field goal drives -- the second after a takeaway deep in Rams territory.
But his biggest play was a nine-yard completion to Nelson Agholor on a 3rd-and-8 with 1:52 left that enabled the Eagles to run out all but the last few seconds on the clock.
"They went two-man coverage and it was 1-on-1 inside, and Nelson did a great job of getting off his defender," Foles said.
"I threw it away from his defender, and he did a great job catching it and getting the first down and it allowed us to run a lot of the clock out, which was big."
Head coach Doug Pederson, who was Foles' position coach with the Eagles in 2013 and his offensive coordinator in K.C. last year, showed a tremendous amount of confidence in Foles on that third and long.
"I want the ball in my hands," Foles said. "I love throwing the ball. I love having the ball in my hands, making decisions.
"It's one of those situations where, 'Hey, if it's not there you either run (or) just don't make it worse,' and Nelson did a great job. Coach Pederson showed a lot of confidence in me, and he knows I can go out there and play."
Foles led the Eagles to the playoffs in 2013 with a record-setting Pro Bowl season then went 6-2 in 2014 before getting hurt. He had a dismal 2015 with the Rams and then spent 2016 with the Chiefs before returning to the Eagles this past offseason.
Talk about full circle.
"It's odd. It's kind of crazy. But it's one of those things you don't really think too much about though," he said.
"You're really just focusing on getting a 'W' and we did. A big one on the road."
The Eagles improved to 11-2 and clinched the NFC East title for the first time since 2013, Foles' big season.
"Hell of a job by Nick coming in and making plays when we needed it," Lane Johnson said.
"Nick's a pretty good quarterback. People have forgotten the year he had a few years ago. Nick works his tail off, so I was confident he would do just fine. He was calm. Same Nick he's always been."
Foles' numbers Sunday were modest: 6-for-10 for 42 yards plus a nine-yard scramble.
But he did exactly what he had to do (see observations).
"He prepares, he's had success before in this league as a quarterback," Malcolm Jenkins said. "We understand he's not Carson Wentz and there are some things he can't do that Carson can do, so we'll use common sense with that, but I think everybody feels good about him throwing the ball.
"That throw to [Agholor], that's a dangerous throw, but he put the ball right where it was supposed to be and allowed his receiver to make a play at a crucial point in the game. We've got a lot of faith in Nick, and we're going to lean heavily on him if Carson isn't out there."
Foles is 20-16 in his career as a starter and 15-9 as the Eagles' starter. Sunday in L.A. was his first extended playing time in an Eagles uniform in more than three years -- since he suffered a season-ending broken collarbone injury in Houston midway through the 2014 season.
"I love it," Doug Pederson said. "This guy's come in, he's played a lot of football games in this league. He's started in this league. Guys have confidence in him. I have confidence in him.
"Great way to step in under these circumstances and pull this game out. It's huge for Nick."