Shane Larkin, right, gets to the hoop. (AP)

Free-agent guard Shane Larkin and the Brooklyn Nets have agreed to a two-year, $3 million contract, league sources told Yahoo Sports.

The deal will include a $1.5 million player option for the 2016-17 season.

Larkin, 22, goes to the Nets for the opportunity to solidify himself as a solid NBA backup point guard. After a season with the New York Knicks, Larkin is expected to see considerable minutes behind oft-injured Deron Williams in the Nets’ backcourt. Larkin is an adept pick-and-roll point guard.

Larkin was the 18th overall pick out of Miami in the 2013 NBA draft and spent his rookie year with the Dallas Mavericks. He was traded to the Knicks as part of the Tyson Chandler deal a year ago and averaged 6.2 points and three assists for New York this past season.