Jeremy Lin tweets that he's heading to the Brooklyn Nets

MIAMI, FL - MAY 1: Jeremy Lin #7 of the Charlotte Hornets shoots the ball against the Miami Heat during Game Seven of the Eastern Conference Quarterfinals during the 2016 NBA Playoffs on May 1, 2016 at American Airlines Arena in Miami, Florida. NOTE TO USER: User expressly acknowledges and agrees that, by downloading and/or using this Photograph, user is consenting to the terms and conditions of the Getty Images License Agreement. Mandatory Copyright Notice: Copyright 2016 NBAE (Photo by Nathaniel S. Butler/NBAE via Getty Images)
Nathaniel S. Butler/NBAE/Getty Images

NEW YORK (AP) Jeremy Lin is heading back to New York.

Lin tweeted Friday that he was signing with the Brooklyn Nets. Terms were not immediately disclosed, and Lin cannot sign with Brooklyn until at least July 7 because of the NBA's offseason moratorium.

Lin's breakout in the NBA came in New York – with the Knicks – during the 2011-12 season. The craze was dubbed ''Linsanity,'' when the then-little-known second-year guard from Harvard scored at least 20 points nine times in a 10-game span and blossomed into one of the league's biggest stories at that time.

Lin started with Golden State, then played for the Knicks and has spent the past four seasons with Houston, the Los Angeles Lakers and most recently Charlotte. He averaged 11.7 points per game last season.