SAN JOSE — The San Jose Sharks have signed Alexander Wennberg to a three-year, $18 million contract, keeping the veteran center in the organization rather than trading him or letting him walk in free agency this summer.

Wennberg, 31, is in the second year of a two-year, $10 million contract he signed with the Sharks on July 1, 2024. He was slated to become an unrestricted free agent and could have been a sought-after player at the NHL trade deadline in March.

Instead, the Sharks, for a variety of reasons, decided that Wennberg, their second-line center, was too valuable to let go as they shored up their center depth for the rest of this season and beyond.

“I’m super excited,” Wennberg said Sunday. “We loved San Jose from the first second we got here, and to be a part of this in the future as well, and make it our second home, we couldn’t be happier. Everything with this organization, what we’re doing here, what we’re building, I’m just super excited. Hard to keep in the emotions, because it’s just something that I always wanted.”

The extension for Wennberg, who was named to Sweden’s Olympic team last week, runs through the 2028-29 season and, as of now, makes he and Tyler Toffoli the Sharks’ two-highest paid forwards. Both deals that have average annual values of $6 million.

Wennberg’s deal, per PuckPedia, also carries a no-trade clause through the 2027-28 season. For the 2028-29 season, Wennberg has a 12-team no-trade clause for the final year of the deal, which he said came together quickly.

“I always wanted to re-sign here, and the fact that we did it right now, for me, it was no hesitation at all,” Wennberg said. “I feel like everything about this is great fit for me, and I feel like it really helps the team as well. So it just worked.”

With the Sharks still in a rebuild and out of the playoff picture in recent years, general manager Mike Grier has opted not to re-sign several pending UFAs. Instead, San Jose has sent them to contending teams, mainly for draft picks and prospects, before the trade deadline.

Some of the more notable recent examples include trading Anthony Duclair to the Tampa Bay Lightning two years ago and center Mikael Granlund and defenseman Cody Ceci to the Dallas Stars last season.

The Wennberg signing signals a change in direction. While the Sharks could still be trade one of their many other pending UFAs before the March deadline, it now appears they’re more open to re-signing players who they feel fit long-term.

Replacing Wennberg, at least in the short term, wouldn’t have been easy for the Sharks. The free-agent market for centers this season does not look particularly appealing, and San Jose’s top center prospect, Michael Misa, is still not established as a full-time NHL player.

Keeping Wennberg past this season perhaps allows Misa some time to develop as a third-line center without forcing him into the top-six right away. Misa right now is playing for Canada at the IIHF World Junior Championship; it is not totally clear whether he’ll return to the Sharks or be loaned back to Saginaw of the Ontario Hockey League after the tournament is over.

For now, the Sharks (20-18-3) know they have Wennberg for their playoff push, as they entered Sunday just outside of a postseason position based on points percentage.

Wennberg has been entrenched as the Sharks’ second line center since the start of the season and enters this week tied for third on the team with 26 points in 41 games this year. He’s also a big part of both the Sharks’ power play and penalty kill.

“For sure, he’s an important piece of our team,” Sharks coach Ryan Warsofsky said last week after Wennberg was named to Sweden’s Olympic team. “He plays in all the situations, a guy that we trust late in games. … He impacts every situation. When you lose centers, they’re tough to replace. So he’s been very valuable for us, and I think he’s took his game to another level.”

Wennberg has 396 career points in 830 career games in the league with the Sharks, New York Rangers, Seattle Kraken, Florida Panthers and Columbus Blue Jackets.