DeMar DeRozan turned the biggest year of his career into a very big contract.​

The All-Star shooting guard is staying with the Toronto Raptors and agreed early Friday to a five-year deal, according to multiple reports.

The Vertical reported the deal is worth $139 million-plus US, which works out to around $28 million per year.

DeRozan can sign on or after July 7, when the league's off-season moratorium on player movement expires. He averaged a career-best 23.5 points this past season, becoming only the third Toronto player to ever score at such a pace — joining Vince Carter and Chris Bosh.​

Teammate Kyle Lowry took to Instagram to congratulate his teammate.

Raptors general manager Masai Ujiri had said re-signing the 26 year old was his top priority, and the two sides took little time coming to an agreement barely two hours after the July 1 free agency window opened.

DeRozan averaged a career-best 23.5 points this past season, and combined with Lowry for one the top backcourts in the NBA. DeRozan and Lowry led the Raptors to their first appearance in the Eastern Conference finals and within two wins of the NBA finals.

The morning after their thrilling playoff ride ended, DeRozan told reporters: "I took pride in putting that Raptors jersey on when people counted us out, or when people said 'Why go to Toronto? Why this, why that, why this, why that?"'

"My mindset has always been Toronto. I was passionate about it when we was losing. When we was terrible, I said I'm going to stick through this whole thing and I want to be that guy who brings this organization to where it is now. I definitely don't want to switch up after we win."

USA Today Sports first reported that DeRozan and the Raptors had reached a deal.

Raptors centre Jonas Valanaciunas posted his congratulations on Twitter.

Canada has two reasons to celebrate today. Happy Canada Day! And congrats on resigning <a href="https://twitter.com/DeMar_DeRozan">@DeMar_DeRozan</a> ! <a href="https://twitter.com/hashtag/WeTheNorth?src=hash">#WeTheNorth</a> —@JValanciunas

There was some speculation the Compton, Calif., native would look elsewhere, including his hometown Los Angeles Lakers, but DeRozan all but spiked those rumours after the Raptors were eliminated in six games by the Cleveland Cavaliers.

"We're looking forward to it," DeRozan said when asked about the Raptors' future.

The popular Raptor is coming off a thrilling season that saw him shine in the playoffs despite a badly injured thumb. He scored 28-plus points in six post-season games. He also teamed up with Lowry in the NBA all-star game in Toronto, and the two will be teammates on the U.S. Olympic team next month in Rio.

Ujiri and the Raptors now turn their attention to either re-signing Bismack Biyombo, or finding a suitable replacement for the rim protection Biyombo gave them.​