After a 113-day lockout and 625 lost games, we are finally going to have a hockey season. It could begin Jan. 19.

It’s game on for the National Hockey League after the NHL and the players’ union reached a tentative deal early Sunday morning on a 10-year collective-bargaining agreement to end the lockout and avert the league’s second canceled campaign in eight years.

Much of North America was sleeping when the sides agreed to the deal at about 4:40 a.m. in the Hotel Sofitel in midtown Manhattan after a marathon 16-hour session that included federal mediator Scot Beckenbaugh. It was 5:45 a.m. when NHL Commissioner Gary Bettman and NHL Players’ Association Executive Director Donald Fehr addressed reporters to announce the lockout was over.

“We have reached an agreement on the framework of a new collective-bargaining agreement” were Bettman’s words that ended the nightmare for hockey fans on both sides of the border.

“I learned of the deal when I woke up to my wife saying, ‘Yay, it’s over,’ ” Buffalo Sabres goaltender Ryan Miller said in a text message to The Buffalo News on Sunday afternoon from his home in Southern California.

There were no media briefings Sunday, and most NHL teams, including the Sabres, made no official comments while awaiting word from the league on how to proceed. The deal still needs to be ratified by both sides, though that is considered a formality.

“I’m really happy a deal has been reached,” Pittsburgh Penguins superstar Sidney Crosby told the Pittsburgh Tribune-Review. “It’s exciting to know we will be back playing hockey.”

The Sabres have not played a game since April 7 in Boston, their final game of the 2011-12 season that ended with their missing the Stanley Cup playoffs. They have not played in First Niagara Center since an April 3 overtime win over the Toronto Maple Leafs, a nine-month absence from the home ice that has wreaked havoc with the bottom lines of downtown bars, restaurants, hotels and workers that staff the arena and its environs.

Teams will hold training camp this week, with CBC reporting late Sunday night that the league has recommended camps open Saturday or next Monday in preparation for a 48-game season that will begin Jan. 19. The league is hoping to firm up those details today. A similar lockout in 1995 ended Jan. 11 and produced a 48-game schedule that began Jan. 20 and lasted into early May.

This work stoppage wiped out more than half the season’s calendar. The biggest game lost was the Winter Classic, which was scheduled to be played New Year’s Day between the Maple Leafs and Detroit Red Wings at Michigan Stadium in Ann Arbor, Mich. The All-Star Game slated to be played Jan. 27 in Columbus, Ohio, was also canceled. The highlights of the new deal look like this:

• It’s a 10-year term with an opt-out by either side after year eight. So that means no more labor issues until 2020 at the earliest.

• There will be a 50-50 split of revenues between the players and league, with the NHL providing $300 million in make-whole money to fund previously signed contracts.

• For this season, the salary cap for player contracts is $70.2 million, based on a full season of 82 games. The cap for next year will drop to $64.3 million, which was one of the most contentious issues. The league had wanted that figure also to be at $60 million. The salary cap floor the next two years will be $44 million.

• Teams will be allowed two amnesty buyouts of player contracts, beginning in June. The contracts will have to be paid at two-thirds of their value, but the entire value will be removed from a team’s cap. The buyouts must be used up following the 2014-15 season, either by one in each year or two in one year and none in the other.

• Player contracts will be limited to eight years for returning players or seven years for free agents, with contract salary variance capped at 35 percent per season. The league had wanted as little as a 5 percent variance. The salary of no year will be allowed to be less than 50 percent of the highest-paid year.

• Revenue sharing between teams will be pumped to $200 million, with a $60 million growth fund put in place.

• The union will also have defined pension benefits, with owners assuming liability.

• The draft lottery will be weighted, with all 14 nonplayoff teams having a chance at the No. 1 pick. Previously, only the top five teams were able to move to No. 1.

• In other issues, the players stood firm on the July 1 opening to the free agency period, and that will remain. NHL players’ participation in next year’s Winter Olympics in Sochi, Russia, and a geographic realignment of the NHL’s teams for next year were not part of the agreement and will be worked on through league committees.

“The negotiated agreement represents the successful culmination of a long and difficult road in which the parties ultimately were able to reach mutually acceptable solutions to a wide variety of contentious subjects of bargaining,” federal mediation and conciliation director George Cohen said in a statement.

Players were given details in a conference call with union officials Sunday night.

“We have to do the legal work, we have to do the constituent communication work, and, at least from my standpoint and from Gary’s, too, we need to let them know the details before we tell all of you,” Fehr said. “We’ll get back to what we used to call business as usual just as fast as we can.

“Hopefully, within just a very few days, the fans can get back to watching people who are skating and not the two of us.”

Bettman had threatened to cancel the season as soon as Thursday if a deal was not reached. That’s what happened in 2004-05, and most hockey experts felt the damage of another canceled season to fan loyalty would be just about irreversible.

As it is, Miller said, he understands the damage this lockout has done to the NHL brand and knows some quick work will be needed to regain fans’ trust. The Sabres have had fewer than 50 season-ticket cancellations out of their 15,400, but this is a rabid hockey town. Not every NHL city is.

“I am happy the Buffalo fans were so patient. I’m not sure we get that in every market,” Miller said. “The NHL is taking a big risk. Hope we don’t injure the game beyond repair.”

Players hurriedly made plans to leave teams in Europe and return to North America for training camp. The Sabres have had nine players overseas at various times, and six of them – Jason Pominville, Christian Ehrhoff, Alexander Sulzer, Tyler Myers, Andrej Sekera and Jhonas Enroth – are still there. Myers did not play in his team’s game Sunday night in Austria in anticipation of his return home.

Ottawa Senators winger Milan Michalek was on a bus in the Czech Republic on the way to a road game when he got a call that the lockout was over. According to his agent, Allan Walsh, Michalek asked for the bus to pull over at a gas station, said his goodbyes, got his equipment off the bus and had a friend come get him to start the trip back to Canada.

Boston Bruins tough guy Milan Lucic, whose jarring hit gave Miller a concussion and basically ruined the Sabres’ season last year, tweeted in part, “Sorry that it took so long. Let’s put the lockout behind us and look forward to some hockey. Best Serbian Christmas present I can ask for. Time for another [Stanley] Cup.”

And Edmonton Oilers winger Sam Gagner tweeted thanks to Beckenbaugh, saying, “Next time I’m in NYC, dinner is on me. Thanks for helping get us back on the ice.”