Less than 24 hours before training camp opens Friday, the talks between Flyers general manager Chuck Fletcher and the agents for restricted free agents Ivan Provorov and Travis Konecny intensified.

But only Provorov got a deal done Thursday.

The defenseman agreed to a six-year $40.5 million contract with an annual salary-cap hit of $6.75 million, according to sources close to the situation. He will officially sign Friday.

Mark Gandler, Provorov’s agent, called it a long negotiation battle, one he said started over a year ago with Ron Hextall, who was then the Flyers’ general manager.

“It was a hard day,” Gandler said on Thursday night. “I’m obviously happy, and Ivan is as well that he can start training camp with his teammates and a new coach and new staff. He can get this thing going and win games. That is really the ultimate fun about this business, but you can’t get there without the contract, so we’re happy it’s finally over. The last couple days were hard-fought by both sides; it was a difficult contract."

The signing will leave the Flyers with about $6.7 million in cap space, per CapFriendly. The Flyers have $74.8 million committed to 20 players. The cap maximum is $81.5 million.

Provorov, 22, who will become an unrestricted free agent when his new contract expires, has been working out at the Flyers’ training facility in Voorhees and will be ready for camp Friday.

Provorov, the Flyers’ No. 1 defenseman, is coming off a subpar season in which he had just 26 points and a minus-16 rating. He excelled the previous season.

Konecny, 22, who might play right wing on the Flyers’ top line, is working out in Ontario.

Mark Guy, Konecny’s agent, characterized the negotiations as “cordial” earlier this week. But TSN’s Bob McKenzie reported Thursday that the “crux of the problem” seemed to be that the Flyers based their offer on the fact that Konecny averaged less than 15 minutes of ice time in his first three seasons, most of them under coach Dave Hakstol.

On Thursday night, Guy said talks had broken off for the evening.

Konecny scored 24 goals in each of the last two years. Last season, he had 20 even-strength goals. That was tied for 55th in the NHL, but only five players his age had more.

New Flyers coach Alain Vigneault recently talked to both restricted free agents in separate phone conversations, and while he told them he understood their situations and their stances, he explained it was important they were in camp at the start so they could grasp his system.

He will at least have Provorov, and it wouldn’t be surprising if Konecny was at camp shortly.