J.R. Smith and the New York Knicks have agreed on a four-year, $24.7 million contract, Smith's agent Leon Rose said Thursday morning.

The contract is the maximum salary that the Knicks could have offered Smith given the team's Early Bird exception.

The Milwaukee Bucks, Detroit Pistons and Dallas Mavericks also showed interest.

Smith averaged 18.1 points and 5.3 rebounds per game during the regular season en route to being named Sixth Man of the Year, but struggled badly in the playoffs, receiving a suspension and shooting 33 percent from the field.