The deal is for two years and $10 million, league sources said, and includes a player option for the second year.
Williams thanked Sacramento fans for their support before confirming the Knicks accord Friday night on Twitter:
Sacramento was more than I expected, thank you to all the fans for all the the support the last year and a half !— Derrick Williams (@Derr13k) July 4, 2015
But I'm a New York Knick now. If you can make it here, you can make it anywhere #Knickstape !— Derrick Williams (@Derr13k) July 4, 2015
Earlier on Friday, the Knicks gained a commitment from center Robin Lopez, who agreed to a four-year, $54 million contract with New York after fellow free agent DeAndre Jordan passed on the Knicks to agree to a contract with the Dallas Mavericks.
New York has approximately $2.5 million in cap space left to spend in free agency. The club also has access to the $2.8 million room exception.
Williams, an unrestricted free agent, has been a bust since the Minnesota Timberwolves made him the second overall pick in the 2011 draft. The power forward has averaged just 9.3 points and 4.3 rebounds in his four seasons, paltry numbers for a player the Wolves had counted on to be the foundation of their future.
Williams wasn't much better in Sacramento, and after a zero-rebound game in April, coach George Karl said of his 6-foot-8 power forward: "You shouldn't be playing 20 minutes a game and not get a rebound. I mean, the Coke machine can get a rebound some nights."
Williams did perk up some down the stretch in 2014-15, averaging 14.8 points and one 3-pointer per game. Whether the 24-year-old can continue that into next season with the Knicks will be the question.
ESPNNewYork.com's Ian Begley contributed to this report.