In the fourth quarter Sunday, as he prepared to lead the team he had joined three weeks earlier, Taylor Heinicke got an unexpected visitor. Washington Football Team rookie Chase Young ran out to the huddle to pump up the quarterback who had just replaced Dwayne Haskins, the former future of the franchise. Heinicke hadn’t appeared in an NFL game in two years, and he had spent most of the fall taking online classes. Young didn’t remember what he told Heinicke — he got lost in the moment — but he remembered what Heinicke told him.

“I got you, bruh. This is what I do.”

After the game, recounting the story, Young grinned and said, “I was like, ‘Okay, he got some swag.’”

From his first play, Heinicke was a clear upgrade over Haskins, who was released by Washington on Monday. The 27-year-old completed half as many passes on his first drive (seven) as Haskins had in 3½ quarters (14), and he pushed for a comeback by throwing for the team’s only touchdown. But his solid effort — 12 for 19 for 137 yards and a touchdown, plus three rushes for 22 yards — proved too little, too late in the 20-13 loss, squandering a chance to clinch the NFC East.

Yet those final two drives might have been a glimpse of the future. Starting quarterback Alex Smith is still dealing with a troublesome calf strain in his surgically repaired right leg, and if he can’t go, Coach Ron Rivera said on Monday that Heinicke will start next week when Washington plays at Philadelphia on “Sunday Night Football,” needing a win to make the postseason.

“It was gutsy,” Rivera said Sunday of Heinicke’s performance. “I thought he took advantage of what they were doing in terms of playing soft and allowing him to take the underneath, allowing him to hit certain throws. I thought his decision to take off and run was outstanding. I thought he had great vision. He went through his progressions and read the defense well and gave us a chance, which is all you can ask.”

This is a remarkable rebirth for Heinicke’s football career. Heinicke himself called the situation “pretty bizarre, actually.” Three weeks ago, he was at home preparing for final exams at Old Dominion. He had returned to the school where he had set records and gotten on the NFL’s radar, becoming an undrafted free agent in 2015 and being with four teams in four years, including Rivera’s Panthers in 2018. After that, he faded from the league, and this spring, during a brief XFL season, he was a backup for the St. Louis BattleHawks.

This fall, he returned to college. He took four classes toward a bachelor’s degree: partial differential equations, applied numerical methods, mathematics in nature, and number theory and discrete mathematics. He was preparing for final exams when Washington called in early December, and he emailed his professors to explain the situation. They were “pretty nice about it,” he said, so he took two of his finals then — one A, one B — and postponed the other two until after the season.

“I’m not really looking forward to those,” he said.

After the game, he was asked which was harder — advanced mathematics or the NFL?

“Um, that’s a tough question,” he joked, grinning underneath his mask. “But, no, probably the NFL. There’s nothing harder than coming out cold, haven’t been on a team in a year and a half and then come in the fourth quarter and try to get something done.”

After Haskins’s disastrous first half, including three turnovers and several errant throws, Rivera said he considered making the switch to Heinicke. But he remembered the way Washington had looked in the second half the week before against the Seattle Seahawks, when Haskins settled down after a rough start and put the team in position to score.

“I was hoping for the same thing,” Rivera said, but he didn’t get it. The first drive of the second half stalled, and Washington kicked a short field goal. The second ended after Haskins missed an open receiver over the middle on fourth and two and was sacked.

Early on, Heinicke looked sharp. He hit the checkdowns key to the Air Coryell-based offense, and he took shots deep. Washington had brought Heinicke back from the books because of his familiarity with coordinator Scott Turner’s offense — they had been together for three years between Minnesota and Carolina — and the benefits of his understanding were immediate and obvious.

Two examples of the offensive resuscitation under Heinicke were incompletions. Yes, incompletions: The first was a deep ball over the top that wide receiver Cam Sims couldn’t hang on to, and the second was deep up the seam, just beyond the reach of tight end Logan Thomas. Neither pass moved the ball, but they were on target and seemed to energize the offense.

Heinicke had thrown to receivers in practice, but as a sort of “quarantine QB” he was, by design, supposed to avoid most of his teammates. He was signed to prevent any potential breach of coronavirus protocols from wiping out the entire quarterback room, which happened to the Denver Broncos earlier this season.

“We had a quick conversation when he first came in,” Sims said. “He’s a QB, so you got to talk to the QB and be friends.”

Two plays after the pass to Thomas, Heinicke scrambled to convert on third and 10. He hit Thomas for a 13-yard gain. He escaped a collapsing pocket, bought time and saw running back J.D. McKissic beat his defender up the left sideline. He hit the throw for a 29-yard touchdown, looking every bit the “gunslinger” Rivera said he was. Heinicke said that, after the pandemic ended the XFL season, he had gone home and had been training ever since.

“I was prepared for this moment,” he said. “I am fortunate that it happened.”

In the postgame scrum at midfield, Heinicke was greeted by enthusiastic Panthers players. He might have, because of the strangeness of this season, known more of them better than his own teammates. But in those final moments, he had shown his new team why he might be the guy to go to with the division on the line. He even sounded like a true starting quarterback after the game.

“We did a pretty good job,” he said. “We will look at the film, and there are probably some things to improve.”