Blue Jackets left wing Artemi Panarin looks on in the...

Blue Jackets left wing Artemi Panarin looks on in the third period against the Coyotes in Glendale, Ariz., on Feb. 7. Credit: AP/Rick Scuteri

It was the worst of times, it was the best of times. Less than 24 hours after the Knicks struck out in free agency during one of the worst days in franchise history, their fellow Madison Square Garden tenants landed the biggest name in the NHL free-agent market, Russian forward Artemi Panarin, who reached agreement with the Rangers on a seven-year deal worth $81.5 million Monday.

“When you add a person like Panarin . . . he’s only 27 years of age,’’ said Rangers president John Davidson, who was president of the Columbus Blue Jackets when Panarin played there. “He’s averaged 80 points over the last four seasons that he’s played in the NHL. We know he wants to be here in New York, specifically with the Rangers — it’s a perfect fit.’’

The Rangers beat out several teams, including the Islanders and Panthers, to sign Panarin, a righthanded-shooting left wing who had 28 goals and 59 assists for the Blue Jackets last season. The 5-11, 168-pounder reportedly turned down more money from other teams; according to reports, he was offered more than $12 million a year by the Islanders and the Avalanche. Columbus also made a late push Sunday to get him to come back, offering more than $12 million a year over eight years.

But Panarin long ago made it clear that he wanted to play on a bigger stage, in a bigger city. Davidson said Panarin had told Blue Jackets management that he intended to leave Columbus so he could do that. That made the Rangers the early favorite to land him. Knowing they had that advantage, they were able to set a ceiling for what they were willing to offer him and stick to it, although the Panthers had the advantage of no state income tax in Florida.

The Panthers and Islanders also were able to offer the chance to bring Panarin’s Columbus teammate, Russian goalie Sergei Bobrovsky, with him in a package deal. But Panarin wanted to play for the Rangers, and that was that.

“He knows it’s New York City; he knows it’s Madison Square Garden,’’ Davidson said. “He’s a very thoughtful individual. He had two years in Chicago [2015-17] that were terrific. He was loved in Columbus. But the way the CBA reads, he has the absolute right, when the time comes, to do what he wants to do. And he had decided to move on to a bigger city. He kept his word.’’

Earlier in the day, the Rangers opened space under the salary cap by trading left wing Jimmy Vesey to Buffalo for a third-round pick in 2021. Vesey, 26, played three seasons for the Rangers and had 17 goals and a career-high 18 assists in 81 games last season.

Later in the afternoon, just before Davidson and Rangers general manager Jeff Gorton got on a conference call to talk about Panarin with the media, the club announced it had signed two other free agents, forwards Greg McKegg and Danny O’Regan.

Gorton has had a very active summer, also trading for defensemen Adam Fox and Jacob Trouba and taking forward Kaapo Kakko with the No. 2 overall pick in the NHL Draft. Gorton said that in addition to scoring goals and making plays, Panarin will be a good influence on some of the young Rangers — Pavel Buchnevich, Vitali Kravtsov, Filip Chytil, Kakko and others.

Panarin’s addition could affect Chris Kreider. He’s set to be an unrestricted free agent next summer, and if the Rangers don’t sign him to an extension, they’ll likely trade him this summer.

“We’ve had a couple chats with Chris’ group, and where it goes, how this affects our players, I think we have to take some time to figure that out,’’ Gorton said.

“Today’s obviously a big day for us, getting Panarin. And that’s what we’re thinking about right now. But in the next few days, we’ll start to figure out what’s next and where we go from here. Chris, in particular, a really good player, he’s a player we like a lot, and we’ll continue to talk to [agent] Matt Keator and Chris and see what’s next.’’

Kreider, who has been the first-line left wing, is scheduled to earn $4.625 million this season. Trading him could clear money under the cap that would help re-sign restricted free agents Trouba, Buchnevich, Brendan Lemieux and Tony DeAngelo.

More Rangers

Newsday LogoSUBSCRIBEUnlimited Digital AccessOnly 25¢for 5 months
ACT NOWSALE ENDS SOON | CANCEL ANYTIME