PHILADELPHIA — The game was over, except for the formality of the clock ticking to zero, so the Philadelphia Eagles decided to give Nick Foles a grand exit. With about two minutes remaining, he walked off the field, jumping and waving his arms wildly before a raucous audience, the franchise quarterback who could have been returning to distort time and reason.

As Foles neared the sideline, Carson Wentz — the Eagles' current but injured wonder quarterback — greeted him for the most improbable hug of this NFL season. When Wentz finished, Coach Doug Pederson swallowed Foles in an embrace. A few feet away, Eagles owner Jeffrey Lurie danced with the running backs. The fans at Lincoln Financial Field sang along to Tom Petty's "I Won't Back Down."

In his dizzying career of extremes, Foles had reached the ultimate high, resurrecting a career that almost ended in premature retirement two years ago and delivering a legendary performance in Philadelphia's 38-7 throttling of Minnesota in the NFC championship game. The 6-foot-6 quarterback, a sometimes awkward-looking backup once relegated to don't-mess-it-up status, stood grand in the pocket Sunday night, rifling accurate passes all over the field and picking apart the NFL's top-ranked defense.

Underdog Eagles blast Vikings to reach the Super Bowl

By the time Foles received his hero's exit, he had completed 26 of 33 passes for 352 yards and three touchdowns. He was unstoppable, and an Eagles squad eager to show it deserved credit for being a complete team was unbowed. When Wentz wrecked his left knee 13 games into an MVP season, the Eagles should have been done. Instead, they proved the entire roster had risen to Wentz's level.

After Wentz went down, Pederson gave one of his typically simple answers to a question about whether Philadelphia could overcome the loss of its great quarterback.

"You sure can," Pederson said. "Heck, yeah."

And so the Eagles did. Heck, yeah, they did.

They relied on a defense that finished the regular season fourth in the league. They relied on their elite running game. They eliminated mistakes and played simple, clean football. And when the stage demanded more, Foles stopped acting like a placeholder and again turned the Eagles into his team.

Afterward, Foles arrived at a postgame news conference wearing glasses and looking like a science teacher as he declared, "I haven't had time to really comprehend what is going on."

It amounts to a glorious circular story for Foles and the Eagles, who have a history of bad things happening for no good reason. Just four years ago, while Wentz was finally rising to starting quarterback as a redshirt junior at North Dakota State, Foles carried the Eagles' hopes. Remember how the former third-round pick burst into stardom in the second half of the 2013 season? With Foles as the starter under Chip Kelly, the Eagles went 7-1 to close 2013 and then won six of their first eight games the next season. In that sample size of a full season, he looked like a dependable star: 4,432 yards, 34 touchdowns, 12 interceptions, 100.4 passer rating. Most importantly, Philadelphia went 13-3 during that stretch.

Patriots overcome injuries, deficit to return to Super Bowl

Then, on Nov. 2, 2014, a week after Foles threw for 411 yards in a loss to Arizona, he suffered a shoulder injury in the first quarter against Houston. Linebacker Whitney Mercilus slammed him to the ground, and when Foles rose, his left shoulder was dangling. He exited the stadium in a sling.

After that, he was no longer the Eagles' great hope. His career turned transient. Kelly lost interest, and the Eagles traded him to the then-St. Louis Rams for Sam Bradford. Foles struggled with the Rams during the 2015 season, and his career as a starter ended. He contemplated retirement before spending 2016 in Kansas City and returning to Philadelphia this season.

"I talked a lot to my wife, and I remember just saying a prayer," Foles said of his retirement thoughts. "I literally said a prayer, and my heart said go back. I am a better person because of that decision. It wasn't an easy decision. It's not like it was 100 percent, but my faith and my guidance and the way I felt like going into that experience allowed me to grow to make me a better player now. And I'm very grateful I made the decision I did — and we made."

If Foles hadn't made that decision, perhaps the Eagles' season would have gone to waste after Wentz's injury. Philadelphia was hoping for competence at quarterback. Now it's getting high performance. In the divisional round, Foles completed 23 of 30 passes for 246 yards and didn't make any huge mistakes. But on Sunday, he was the star, ignoring pass rushers coming after him and exploiting flaws in the Vikings' secondary.

"It couldn't happen to a better guy," Minnesota quarterback Case Keenum said of his counterpart. "He's been through so much that a lot of people don't know about. The way he came out and played, it couldn't happen to a better guy. It really can't. Obviously, this is still hurting a lot right now, but I'm going to be rooting hard for him."

By the fourth quarter, Eagles fans were taunting Minnesota by editing the famous "Skol" chant and shouting "Foles!" in its place. The score was 38-7, and there were still 14 minutes left.

Foles didn't reward time or stop it or press fast-forward to provide a glimpse of the next phase of his career. No, he obliterated the concept of time. He merged his past, the good and the bad, and he took all of those lessons to create something new, something better.

For the Eagles, it was a fitting way to emerge from the mess that Kelly made and enter a more promising era. For the first time since 2004, they're headed to the Super Bowl, and New England again will be the opponent.

This time, they go feeling like something special is happening. They don't want to explain it. They just want to stick out their chests and say told you so.

In the middle stands Foles, back to life as a difference maker. As he knows too well, stardom doesn't always last long. He's not asking for long, though. He just needs one more game.

For more by Jerry Brewer, visit washingtonpost.com/brewer.

More from The Post:

The Eagles, underdogs in their own back yard, blast Vikings to earn Super Bowl berth

Patriots overcome injuries, 10-point fourth-quarter deficit to return to Super Bowl

Bill Belichick again could hardly be bothered with AFC championship trophy

Sally Jenkins: Another Patriots Super Bowl appearance wasn't inevitable, but it sure seemed that way