Kawhi Leonard, left, and Rudy Gay, center, stand with Danny...

Kawhi Leonard, left, and Rudy Gay, center, stand with Danny Green during a game on Jan. 21. Credit: AP / Eric Gay

Seeing a window of opportunity in the Eastern Conference with LeBron James’ departure, the Raptors rolled the dice Wednesday and completed a trade with the Spurs for superstar Kawhi Leonard.

The Spurs agreed to send Leonard, who has a year left on his contract, and Long Island’s Danny Green to the Raptors for five-time All-Star DeMar DeRozan, Jakob Poeltl and a protected 2019 first-round pick.

It appears that neither Leonard nor DeRozan are happy with the trade.

Leonard, who can leave at the end of next season, had previously told teams that were interested in trading for him that he only wanted to go to the Clippers or the Lakers.

DeRozan spent his entire career with the Raptors and has scored more points for the team than any player in franchise history. As news of the potential trade came out Wednesday, DeRozan posted on Instagram: “Be told one thing & outcome another. Can’t trust em. Ain’t no loyalty in this game. Sell you out quick for a little bit of nothing.”

DeRozan, who will turn 29 next month, has averaged 19.7 points per game over his career. He averaged a career-high 27.3 points per game during the 2016-17 season.

Leonard played in only nine games last year as he dealt with a somewhat mysterious quadriceps injury. He reportedly asked the Spurs to trade him last month. Leonard has averaged 16.3 points per game in seven seasons with the Spurs, but averaged 25.5 points and finished third in the league’s MVP voting in the 2016-17 season.

Toronto won a franchise-record 59 games this past season, but suffered a humbling sweep by James and the Cavaliers in the second round of the playoffs. The Raptors fired coach Dwane Casey after the sweep and with this trade it is clear they felt they had gone as far as they could with their current group.

In taking Leonard, the Raptors are gambling that they can change Leonard’s mind about playing in Toronto, similar to what Oklahoma City did last year with Paul George.

Leonard, who recently turned 27, is expected to enter free agency next summer when a loaded class hits the open market. Along with Leonard, Kevin Durant, Kyrie Irving, Klay Thompson, Jimmy Butler, Kemba Walker and Kevin Love also could be free agents. The Knicks and Nets will both have cap space and are expected to be active in free agency next summer.

Green, a North Babylon native who starred at St. Mary’s in Manhasset, has spent eight of his nine NBA seasons with the Spurs. He has averaged 8.8 points per game over his career.

On Instagram Wednesday, Green, 31, posted a photo of him hugging Spurs coach Gregg Popovich during a locker room celebration. He thanked the fans of San Antonio and then added “I’m looking forward to my next chapter in TORONTO.”

More NBA news

Newsday LogoYour Island. Your Community. Your News.Digital AccessOnly 25¢for 5 months