After about 64 hours of angst, it’s officially official.

John Harbaugh is the head coach of the New York Giants.

The Giants and Harbaugh signed a five-year contract on Saturday afternoon.

“I want to thank John Mara, Steve Tisch, Chris Mara, and Joe Schoen for the opportunity to lead the New York Giants,” Harbaugh said in a statement released by the team. “To serve as this franchise’s head coach is a tremendous honor. I come from a football family, and I have deep respect for the history and tradition of this organization.

“I’m excited to begin assembling our staff and getting to work building our team. I would like to sincerely thank Steve Bisciotti and the Baltimore Ravens organization for 18 remarkable years, including the opportunity to become a head coach in the National Football League.

“My family and I are grateful for the welcome we’ve already felt, and we look forward to becoming part of the Giants family.”

The two sides verbally agreed late Wednesday night but then spent all of Thursday, Friday and some of Saturday hashing out the details in writing of a complicated contract.

That’s because Harbaugh, 63, is the most accomplished coach that the Giants have ever hired with 180 regular-season wins and a Super Bowl on his resume.

The longtime Ravens coach reportedly wanted clarity on a numerous of issues regarding the Giants’ organizational structure and preferred a situation to what he had in Baltimore where he reported directly to the owner — not the general manager.

The Giants have long had the head coach report to the GM, but Harbaugh will have more power than any head coach in recent memory. This is a franchise that has a 44-104-1 record since 2017 and needs sweeping changes in order to return to stability and winning again, which they had under two-time Super Bowl champion Tom Coughlin from 2014-15.

“Throughout our conversations, John stood out for his clarity, competitiveness and approach for building a sustainable winning program,” GM Joe Schoen said. “He has a strong track record of developing players, building cohesive staffs, and setting a clear standard of accountability. We are excited to work with John in moving this team in the right direction.”

Harbaugh will reportedly make somewhere around $20 million, which would match the Chiefs’ Andy Reid for the highest head coaching salary in the NFL.

The Giants will host a press conference to formally introduce Harbaugh on Tuesday at noon at the Quest Diagnostics Training Center in East Rutherford.

“John is a proven winner whose teams are disciplined, resilient, and prepared,” Giants  co-owner chairman Steve Tisch. “His passion for the game, his ability to connect with players, and his experience leading at the highest level made him an outstanding fit for us, and we’re excited to move forward together.”

The Giants also held in-person interviews with former Browns head coach Kevin Stefanski, former Packers and Cowboys coach Mike McCarthy, former Falcons head coach Raheem Morris, former Raiders head coach Antonio Pierce (also a former Giants linebacker and captain) and interim head coach Mike Kafka.

They had virtual interviews with Broncos defensive coordinator Vance Joseph, Broncos special teams coordinator Darren Rizzi, Seahawks offensive coordinator Klint Kubiak and Colts defensive coordinator Lou Anarumo.

“Joe Schoen presented us an outstanding group of candidates, which allowed us to be deliberate and confident in this decision,” co-owner and team president John Mara said. “Through numerous conversations, John consistently stood out for his conviction and vision for leading a winning organization, and we welcome him and his family to the Giants.”