Marcus Pettersson agreed to terms on a five-year, $20.125 million contract with the Pittsburgh Penguins on Monday. It has an average annual value of $4.025 million.

The 23-year-old defenseman could have become a restricted free agent July 1. He signed a one-year, $874,125 contract Sept. 12, 2019.

"I feel very fortunate to have this opportunity," Pettersson said. "I felt like I said that before, that as soon as I got to Pittsburgh, this is a place you want to be with the history they have and the winning mentality, and the core group still here. I felt like this was by far the best option, and I haven't really thought about anything else but being here for a long time. I'm glad it worked out."

Pettersson has 15 points (one goal, 14 assists) in 50 games this season. He's averaging 19:22 of ice time and is the only Pittsburgh defenseman not to miss a game this season.

"In just over a year, Marcus has had a significant impact on our defensive group," Penguins general manager Jim Rutherford said. "He is young, reliable and smart, which is important in today's game. Marcus is part of our young core and it was important to get him signed long-term."

Video: Pettersson signs extension with Penguins

Pettersson was acquired in a trade from the Anaheim Ducks for forward Daniel Sprong on Dec. 3, 2018. He has 34 points (three goals, 31 assists) in 107 games with the Penguins.

Selected by Anaheim in the second round (No. 38) of the 2014 NHL Draft, Pettersson has 44 points (four goals, 40 assists) in 156 regular-season games and one assist in eight Stanley Cup Playoff games.

Pettersson said when he signed his one-year contract for this season that he was confident the Penguins would sign him for a longer term when they were able.

"The situation we were in in the summer with the (NHL salary) cap being what it was and everything like that, it was just not possible," he said. "We came to a handshake and Jim said that as soon as we can, we can start looking over the next deal and working from there. That put a lot of encouraging thoughts in my head, and I just wanted to do the best I can all year this year and prove that they still want me for the long-term."

NHL.com independent correspondent Wes Crosby contributed to this report