Carl Hagelin re-signed with the Capitals over the weekend. (Nick Wass/AP)

After a season in which forward Carl Hagelin played for three teams and was traded twice, he felt like he was an employee of the NHL rather than any one club. But spending his last 27 games with the Washington Capitals showed him there was one organization he wanted to commit to. He expressed his interest to General Manager Brian MacLellan in returning, but knowing the Capitals’ salary cap constraints, Hagelin was uncertain the sides could make something work.

Two days after Washington freed up roughly $3.4 million in salary cap space by trading defenseman Matt Niskanen to the Philadelphia Flyers for Radko Gudas, the team re-signed Hagelin to a four-year, $11 million deal Sunday. Hagelin, who turns 31 in August, has played for five teams in his career, so he understandably wanted stability with a longer term and was willing to lower the average annual value of the contract ($2.75 million) in exchange. Had Hagelin hit the open market July 1, it would’ve been the first time he was an unrestricted free agent.

“When you sign a deal that’s four years long, it means that there’s a lot of aspects that need to be to your liking," Hagelin said on a conference call Monday. “I think for me, it starts with what kind of team do you have. When you look at the team, the best players are the veteran players who have been there for a while. They’re the leaders, and if you look at today’s NHL, a lot of people talk about the young guys, but the teams that win in the playoffs are the teams with great leadership and good veteran players that have been there before and understand the grind. I think that’s what it starts with.

“Just the way you get treated as a player, it’s first-class, whether that’s the way you travel, the nutrition at the rink — just the way you get taken care of. ... They know my strengths and they play me with good players, and it helps to have success that way.”

After years of playing against Hagelin in the Metropolitan Division — he spent the first four seasons of his NHL career with the New York Rangers before twice winning the Stanley Cup with the Pittsburgh Penguins — Washington acquired him from the Los Angeles Kings in February for a third-round draft pick. He immediately became the team’s top penalty-killing forward, and the Capitals played him everywhere from their top-six forward corps to their fourth line, enamored with his versatility. He continues to be one of the fastest players in the league, and he parlays that into an aggressive forecheck.

This was a relative down year for Hagelin offensively — he had a sprained knee earlier in the season — but he found more of a scoring touch in Washington. After he had two goals and six assists in the first 38 games of the season with Pittsburgh and Los Angeles, he tallied three goals and eight assists in 20 regular season games with the Capitals. He had one assist in seven playoff games.

With the St. Louis Blues recently winning the Stanley Cup with big, physical personnel, there has been talk of teams perhaps shifting to that formula as a recipe for success in the postseason, especially since the Capitals won with a similarly bruising style last year. But Washington believes in a balance of speed, skill and hard hitting, and while the Gudas acquisition gives the team toughness on defense, Hagelin is hard to play against because of his quickness.

“I don’t think there’s a perfect formula to win in the NHL," he said. "But what I like about Washington is it’s a good mix of a heavy team and a speed team. You look at St. Louis, what they did last summer; they brought in a lot of older, veteran guys that turned out to be good players for them in the playoffs. So I’m not sure there’s a formula to win, but I definitely know experience helps and playoff hockey is different than in the regular season.”

Next season’s salary cap has been projected at $82 million to $83 million, and Hagelin’s extension leaves Washington with roughly $10 million in space to work with, according to CapFriendly.com. Barring another trade to free up funds, that will be used to sign five forwards and one defenseman. Restricted free agent forward Jakub Vrana, who’s coming off a career year with 24 goals and 23 assists, will eat up a lot of that money; he’s expected to get a bridge deal with a cap hit in the neighborhood of $4 million. That might mean the Capitals will part ways with pending unrestricted free agent Brett Connolly, who had 22 goals and 24 assists last season, perhaps pricing himself out of Washington.

Even with next year’s roster still taking shape, Hagelin had seen enough to want to be part of the Capitals’ future.

“I stayed with Washington to have a chance to win," he said. "I’ve been fortunate to be in the playoffs every year since I got in the league, and I’ve been to five conference finals and three Stanley Cup finals. And that’s what you love, being in those situations. ... If I didn’t think the Caps had a chance to play in the finals and win the Stanley Cup, I wouldn’t have signed with them.”