Rudy Gay has reached agreement on a three-year, $40 million contract extension with the Sacramento Kings, league sources told Yahoo Sports.

Gay has one year left on his current deal, which will pay him $19.3 million.

The extension begins with the 2015-16 season, and includes a player option for the the 2017-18 season, sources told Yahoo Sports. The ability to exit the deal early gives Gay a chance to become a free agent in the summer of 2017, when he’ll be 31 and the market will be flush with the proceeds of the new $24 billion television package.

Gay's agent, Alex Saratsis of Octagon, finalized the details of the deal with Sacramento management over the past several days, culminating with an agreement on Saturday night. The Kings have wanted to re-sign Gay for several months, and Gay decided to push forward with an agreement in recent days, deciding to bypass free agency in the summer.

For the Kings, the re-signing of Gay is an important statement on the franchise's ability to get high-level players to decide to stay with the organization. For years, it had been a struggle for the Kings, but the new ownership and management regime made the kind of organizational changes needed to court and keep Gay.

As the franchise moves closer to constructing a new downtown arena, the Kings want Gay to anchor a frontline with center DeMarcus Cousins. After a trade from the Toronto Raptors to Sacramento in December, Gay averaged 20 points for the season. Across eight NBA seasons, including stops in Memphis and Toronto, Gay has averaged 18.3 points.

Gay is averaging 22.5 points, 6.8 rebounds and 3.5 assists for the Kings, who are 6-4 this season.

More NBA coverage: