Jordan Eberle of the Islanders celebrates his first-period goal against the...

Jordan Eberle of the Islanders celebrates his first-period goal against the Sabres at NYCB Live's Nassau Coliseum on March 30. Credit: Jim McIsaac

Testing the market was a “last resort” for Jordan Eberle, who has come to appreciate the stability that president and general manager Lou Lamoriello and coach Barry Trotz have brought to the Islanders.

So the impending unrestricted free-agent right wing took his preferred path, agreeing to a five-year deal Friday. An NHL source confirmed that the contract is worth $27.5 million with an annual average value of $5.5 million. Eberle’s new deal also includes a no-trade clause for the first two seasons and a modified no-trade clause over the last three years.

“Negotiations didn’t really start until the end of the year,” Eberle said on a conference call. “If you look at my year, it was definitely up and down. It wasn’t a great start. It wasn’t until maybe February that I really got it going and took my game to another level and into the playoffs. It really was from that moment on that I really wanted to try and get something done and be a part of the Islanders.

“I liked what we had going,” Eberle added. “I was really happy with the way that I was playing and I wanted to pursue that for a full year.”

The Islanders, in their first season under Lamoriello and Trotz, finished second in the Metropolitan Division with 103 points — a 23-point improvement from the previous season — and made the playoffs for the first time since 2016. They swept the Penguins in the first round before being swept by the Hurricanes.

Eberle, 29, is coming off a six-year, $36 million deal he signed with the Oilers, who selected him 22nd overall in 2008. He had 19 goals and 18 assists in 78 games in his second season with the Islanders after being acquired for Ryan Strome on June 22, 2017. He had four goals and five assists in the playoffs, including a goal in each game against the Penguins, and  credited Trotz for improving his two-way game.

“In the back of my mind, I knew that free agency was an option,” Eberle said. “But in my mind, it was going to be a last-resort thing.”

Eberle has 209 goals and 269 assists in 666 NHL regular-season games.

“I’m not a young buck anymore. I’m 29,” he said. “Definitely winning becomes more of a priority. I like the direction the Islanders are going. It’s such a fine line between winning and losing. I think the biggest thing is the character and the camaraderie and the tight-knit group we have on Long Island. I think we have as good a chance as any team.”

The Islanders have re-signed two of their top-six forwards. Center Brock Nelson agreed to a six-year, $36 million deal on May 23. They still have a projected $22 million in salary-cap space. Captain Anders Lee, goalie Robin Lehner, a finalist for the Vezina Trophy, and third-line center Valtteri Filppula can become UFAs on July 1.

The Islanders lost their former captain, John Tavares, last year when he left via free agency for a seven-year, $77 million deal with his hometown Toronto Maple Leafs.

“Anders is on his own path,” Eberle said. “Nobody can really blame him for taking his time or going to free agency. He deserves the right to that. I know, in his mind, he loves Long Island. I support whatever he does. It’s going to be a tough decision either way.”

More Islanders