Free agent guard Yogi Ferrell has agreed to a two-year, $5.3 million deal to return to the Dallas Mavericks, league sources told Yahoo Sports.

Ferrell returned to the Mavericks with the promise of being the backup shooting guard next season, league sources said. The second season of his deal includes a trigger date on July 7, league sources said.

Ferrell, 25, earns a two-year contract after spending his first two NBA seasons with the Mavericks and Brooklyn Nets. He joined the Mavericks on a 10-day contract in January 2017, one month after the Nets waived him. Ferrell was an instant success, and had a performance of 32 points and nine 3-pointers against the Portland Trail Blazers on Feb. 3, 2017, leading to a two-year deal.

In 82 games last season, Ferrell averaged 10.2 points, three rebounds and 2.5 assists per game. The 6-foot guard had interest from several other teams on the market, including the New Orleans Pelicans and Oklahoma City Thunder.

Ferrell went unselected in the 2016 draft after a standout career at Indiana University.