One of the cruelest twists of the Giants season happened with less than five minutes left in the final game.

On an otherwise meaningless snap, Halapio — a 2014 draft pick of the Patriots who didn’t make his NFL debut until 2017 — did not get off the turf. He was carted off the field and left the postgame locker room on crutches.

But it’s not a worst-case scenario for Halapio, who underwent successful surgery without complications to repair a torn Achilles tendon Tuesday at the Hospital for Special Surgery, according to agent Doug Eldridge.

“This is a frustrating way to close out the season, but I believe that opposition leads to opportunity,” Halapio said in a statement thanking the Giants and their fans for support. “I’ll do the hard work necessary to return to the field, the game, the locker room I love so much.”

Halapio, 28, won the starting job each of the last two preseasons but started just two games before a season-ending leg injury in 2018. He is a restricted free agent this offseason, but it sounds as if the injury will not deter the Giants’ interest.

“Now he is not going to be ready until [summer] camp most likely,” general manager Dave Gettleman said.

The Giants will be looking to add at least one new starter (right tackle) on the offensive line.

The Giants fired coach Pat Shurmur but assistant coaches and coordinators remain under contract, free to use their offices but also pursue opportunities with other organizations without the Giants blocking an interview.

Gettleman said they will send assistants to the Senior Bowl as a courtesy because that is the NFL’s “job fair” and he will encourage the new coach to interview holdovers. He expects some of the Giants’ “young coaches” to be part of the staff for the East-West Shrine Game of college stars.

Gettleman maintained the Giants locker room was strong, citing Janoris Jenkins as a rogue example. The veteran cornerback now with the Saints criticized his Giants teammates and the coaching staff at separate points, but the final straw that led to his release was calling a fan a “retard” on social media and botching his forced apology.

“I saw a team that came out, practiced hard every day, and played hard on Sundays,” Gettleman said. “In terms of a culture problem downstairs … first time it’s ever been mentioned to me, and I’m through that locker room all the time on a daily basis. What Janoris said, he said. He’s it. He was it.”

For more on the Giants, listen to the latest episode of the “Blue Rush” podcast: