Philadelphia • Nick Foles contemplated retirement after a miserable season with the Rams in which he ended up losing his starting job to Case Keenum.

That's just one spin of a unique quarterback carousel that'll be on display when Foles and the Philadelphia Eagles (14-3) host Keenum and the Minnesota Vikings (14-3) in the NFC championship game Sunday.

"It’s pretty wild," Foles said. "Case's success and the way he plays doesn't surprise me because him and I were together and we prepared together. We were around each other every day. But I think the big message there is no matter what happens, you've just got to keep believing in yourself, keep working hard and just never give up."

The cycle began when former Eagles coach Chip Kelly traded Foles to the St. Louis Rams for Sam Bradford in March 2015. A day later, the Rams acquired Keenum from the Houston Texans to back up Foles.

Foles went 4-7 in 11 starts for the Rams before he was benched for Keenum. Meanwhile, Bradford had a decent season with the Eagles, but was traded to Minnesota a week before the 2016 season opener to pave the way for Carson Wentz. The Vikings needed Bradford to replace the injured Teddy Bridgewater. Bradford had a career year in 2016.

Foles asked for his release from the Rams after they moved to Los Angeles and drafted Jared Goff No. 1, one pick ahead of Wentz. Foles seriously considered hanging up the cleats before Andy Reid — who drafted him in third round in Philadelphia in 2012 — persuaded him to join the Kansas City Chiefs as a backup to Alex Smith.

Foles played well in two games in relief and then returned to Philly on a two-year deal to provide insurance behind Wentz this season. Keenum helped groom Goff in Los Angeles last year and then went to Minnesota to back up Bradford.

Keenum stepped into the lineup in September after Bradford was injured and had by far the best season of his career, passing for 3,547 yards, 22 touchdowns and only seven interceptions. Foles took over in Philadelphia after Wentz tore his ACL in Week 14.

Now, the former teammates are one win away from starting in the Super Bowl.

"I know this is what all of you guys predicted back in the day, a Foles vs. Keenum NFC championship," Keenum joked. "So good job to all of you guys who predicted that."

The Eagles are fortunate Foles chose to keep playing a year ago.

"I talked a lot to my wife and I remember just saying a prayer," Foles recalled. "Going to back to play for coach Reid, I am a better person because of that decision. It wasn't an easy decision. But I leaned on my wife, I leaned on my family and I leaned on my faith in those moments, and I'm very grateful I made the decision."

Foles started six games his rookie season, going 1-5 on a 4-12 team that got Reid fired after 14 seasons in Philadelphia. He began 2013 as the backup to Michael Vick in Kelly's first season in the NFL and ended up having a sensational year, leading the Eagles to an NFC East title.

He threw 29 TDs and only two picks — including playoffs — and posted a passer rating of 119.2, third highest in league history. He tied an NFL record with seven TD passes in a game at Oakland in November 2013.

Foles wasn't quite as spectacular in 2014, but the Eagles were 6-2 in his eight starts. He tossed 13 TDs, 10 interceptions and missed the final eight games after breaking his collarbone.

Then he went to St. Louis and struggled on another one of Jeff Fisher's losing teams. Keenum, an undrafted free agent in 2012 who bounced around from with the Texans and Rams, also didn't have much success playing for Fisher. Neither did Goff. All three have thrived playing for other coaches.

"You've just always got to believe and you always have to prepare," Foles said. "Sometimes things happen where unfortunately guys get injured and you have to step in and it's your job to lead the team. (Keenum) has really done an amazing job. It doesn't surprise me. That was my job stepping in for Carson to lead this team like I have before."

Foles completed 77 percent (23 of 30) for 246 yards in a 15-10 win over Atlanta last week.

Keenum, 9-15 as a starter before joining the Vikings, followed his breakout season by leading Minnesota to an improbable comeback win against the Saints, tossing a 61-yard TD pass to Stefon Diggs as time expired.

The two quarterbacks are good friends off the field.