– Nick Foles has made the Pro Bowl and been both traded and released as an NFL quarterback. He felt so disheartened during the 2015 season that he contemplated retirement. Now he’s headed to the Super Bowl.

Two weeks ago, the Philadelphia Eagles became a fashionable pick for a quick playoff exit because Foles was their quarterback. Now, they’re one win from hoisting the Lombardi Trophy because Foles is their quarterback.

What a strange journey for a 29-year-old who could write a thesis on the NFL’s unpredictable nature.

“I’m so happy for him for what he’s been through,” Eagles coach Doug Pederson said.

Foles provided one of the most stunning performances in recent playoff history when he picked apart the Vikings’ top-ranked defense in a 38-7 rout on Sunday.

Foles played almost flawlessly in completing 26 of 33 passes for 352 yards and three touchdowns. He kept Mike Zimmer’s defense off-kilter with a perfect mix of short, intermediate and deep passes. He looked one step ahead the entire game.

“We didn’t go out there and play with fear,” Foles said. “We played aggressive.”

His dominance set up a Foles vs. Tom Brady matchup in the Super Bowl at U.S. Bank Stadium. The odds of that scenario seemed low at the outset of the playoffs.

“No one thought we were going to be here after Carson went down,” Eagles tight end Zach Ertz said.

Starting quarterback Carson Wentz was having an MVP-caliber season before suffering a torn ACL on Dec. 10. Foles’ inconsistent play in the final three games did nothing to ease concerns. The Eagles looked like a vulnerable No. 1 seed as the offense tried to recalibrate.

“Our season wasn’t over,” Pederson said. “We were still confident in the players. I talk to the team all the time that it’s not about one guy. One guy can make a difference for you, but it takes a whole team to make it happen.”

Foles has found his groove in the postseason, boosted by a strong support network. He found his rhythm with a game plan heavy on safe, quick-hitting passes against Atlanta in the divisional round. Pederson expanded his playbook and allowed Foles to take more chances down the field against the Vikings.

The doomsday fears about Foles proved to be overreactions.

“In sports, everything is a process,” Foles said. “You can’t give up. When there is a bad outing everyone wants to be really critical. But no one in the locker room doubted me.”

Foles was asked how he knew none of his teammates doubted him, or wondered privately whether he could keep their championship dreams afloat.

“If people doubt you, you can feel it,” he said. “We’re all human. We can keep it real. If someone doubts you, you know. These guys knew I would keep working. They know me as a person. They know me as a player.”

His entire career has been a lesson in patience and perseverance. He made the Pro Bowl in 2013 with the Eagles, who then traded him to the St. Louis Rams in 2015 in exchange for Sam Bradford.

Foles lost his starting job to Case Keenum that season and was granted his release after the team drafted Jared Goff. He spent one season as a backup for the Kansas City Chiefs before returning to Philadelphia this season to serve as Wentz’s backup.

Wentz was on his path to stardom before his knee injury, but the conditions surrounding the quarterback have enabled Foles to step in and succeed, too.

The Eagles own a top-five defense. Their offensive line is regarded among the league’s best. They finished No. 3 in the NFL in rushing. They have a deep and talented group of receivers and tight ends. And the coaching staff sees things from a quarterback’s perspective.

Pederson played quarterback in the NFL for 12 seasons, primarily as a backup to Brett Favre in Green Bay. Eagles offensive coordinator Frank Reich was a 14-year NFL quarterback.

Pederson has a reputation as being an aggressive and savvy play-caller. His game plans are creative.

“He has such a great feel for the game,” Foles said.

His impact was evident in Wentz’s rapid development. Now Wentz can only watch and cheer on Foles as he prepares for the Super Bowl. Those two shared a moment as Foles left the field amid huge cheers after the best game of his career.

“[Wentz] has handled this thing amazing,” Foles said. “It’s been a crazy year. We work together every single day, long hours. You don’t really have to say anything. A hug goes a long ways.”