Restricted free-agent center Mason Plumlee has agreed to a three-year, $41 million deal to return to the Denver Nuggets, league sources told ESPN.

Agent Mark Bartelstein of Priority Sports and Denver president of basketball operations Tim Connelly reached agreement on the deal late Sunday night, league sources said.

With the deal, Denver was able to avoid Plumlee signing a $4.6 million qualifying offer for the 2017-18 season -- which would've allowed him to become an unrestricted free agent next summer.

Mason Plumlee averaged 10.4 points and 7.5 rebounds per game last season. Jerome Miron/USA TODAY Sports

For the Nuggets, the Plumlee deal solidifies one of the NBA's better frontcourts with Nikola Jokic, Paul Millsap and Kenneth Faried.

Denver acquired Plumlee, 27, from Portland in the February deal for center Jusuf Nurkic. In four NBA seasons with Brooklyn, Portland and Denver, Plumlee has averaged nine points and 6.5 rebounds.

Plumlee was the 22nd overall pick to the Nets in the 2013 NBA draft.

The Nuggets will next turn their attention to working toward a rookie contract extension for guard Gary Harris.