Free-agent forward Serge Ibaka has agreed to a three-year, $65 million contract to stay with the Toronto Raptors, league sources told ESPN's Adrian Wojnarowski.

Ibaka's representation, ASM Sports, confirmed that a deal had been agreed to in a tweet Sunday.

Serge Ibaka, 3 years, $65M

Acquired from the Orlando Magic in a trade for Terrence Ross and a first-round pick, Ibaka averaged 14.2 points and 6.8 rebounds in 23 games after the All-Star break deal. Brought in to give the Raptors' All-Star backcourt some much-needed help inside, Ibaka helped Toronto eliminate the Milwaukee Bucks in the first round by averaging 12.8 points, 8.3 rebounds and 2.3 blocks per game in the series.

However, Ibaka's production on the glass dipped considerably to 3.8 rebounds per game during Cleveland's sweep of Toronto in the second round. Ibaka averaged 16.5 points per game against the Cavaliers but shot 48.3 percent from the field in the series.

In 56 games with Orlando last season, Ibaka averaged 15.1 points and 6.8 rebounds.

Ibaka was ranked No. 16 on the list of top available free agents this offseason by ESPN's Kevin Pelton.