Free-agent guard Ricky Rubio has agreed to a three-year, $18 million deal to return to the Cleveland Cavaliers, his agents, Jeff Schwartz and Sean Kennedy of Excel Sports, told ESPN’s Adrian Wojnarowski.

The Cavaliers have also agreed to a one-year contract with free-agent center Robin Lopez, sources told Wojnarowski.

Rubio was enjoying a resurgence with the Cavaliers before an ACL tear in his left knee in December ended his season. Before the injury, Rubio was averaging 13.1 points, 6.6 assists and 4.1 rebounds. He was a mentor to Cavaliers All-Star guard Darius Garland, and his reunion in Cleveland with former Minnesota Timberwolves teammate Kevin Love had helped the forward’s comeback.

The Cavaliers eventually used Rubio’s expiring contract in the trade to acquire Caris LeVert from the Indiana Pacers.

Rubio, 31, played an integral role in Cleveland’s hot start last season, providing the bench with a steadying presence before helping fill a void in the backcourt after Collin Sexton went down with a season-ending knee injury.

While he is unlikely to be ready to return for the start of the season, Rubio, who has twice torn the ACL in his left knee, proved last season he still has plenty left in the tank.

Lopez, 34, is joining his ninth NBA team as he enters his 15th NBA season. He has averaged 8.7 points and 4.9 rebounds while playing for Phoenix, New Orleans, Portland, New York, Chicago, Milwaukee, Washington and Orlando.

The Associated Press contributed to this report.