EDMONTON -- Johnny Hockey is on his way back to the Calgary Flames.

Johnny Gaudreau ended his training camp hold-out two days prior to the beginning of the regular season, agreeing to terms on a new six-year, $40.5 million pact with the Flames.

"As I have always said, I just want to play hockey," Gaudreau tweeted. "I want to be there for my teammates and for the fans of Calgary. I want to thank my family and my agent for all their support during this process. I couldn't have done it without them."

Gaudreau's status for the Flames' season opening Battle of Alberta in Edmonton on Wednesday night is not clear. He has been regularly skating and training with a junior team in the Philadelphia area.

The deal will carry a salary cap hit of $6.75 million through 2021-22, matching Gaudreau with captain Mark Giordano for highest AAV on the team.

Overall, Gaudreau's cap hit will be tied for 44th highest in the NHL, according to GeneralFanager.com.

Gaudreau's contract pays less in total value than teammate Sean Monahan, but the compromise is Gaudreau now has the possibility to become an unrestricted free agent one season sooner. That means the Flames bought just one year of Gaudreau's unrestricted rights with the new deal, which was a point of contention toward the end of negotiations.

The Flames did not want to pay Gaudreau north of Giordano's salary cap hit. Gaudreau's initial ask was believed to be in the $8 million per season range, but the Flames held firm. Despite finishing sixth in league scoring last season with 30 goals and 78 points, Gaudreau did not have normal restricted free agent rights because he did not accrue three seasons of league service during his entry-level contract.

Gaudreau, 23, was not eligible to be courted with an offer sheet and he also did not hold any arbitration rights. His only leverage was to sit out games or ask for a trade.

Instead, the scrappy first line anchor chose to play. The focus will finally be back on the ice now after a long and, at times, contentious negotiation.

Gaudreau, a Carney's Point, N.J., native, was drafted 104th overall by Calgary in 2011. He scored in his first NHL game and has racked up 55 goals and 143 points in 160 career contests.

Contact Frank Seravalli on Twitter: @frank_seravalli