Linsanity is coming back to New York!

Point guard Jeremy Lin agreed to a deal with the Brooklyn Nets on Friday. Lin met with the Nets and the New Orleans Pelicans in California on Thursday and according to ESPN, the deal is for three years at $36 million. The deal includes a player option for the final year, a trade kicker and bonuses. The Nets will have about $40 million in cap space left after the deal.

Lin announced the signing via Twitter.

“The journey continues…thankful for the next chapter!!” he tweeted.

Lin signed a three-year, $25 million contract with the Houston Rockets in 2012 after playing for the New York Knicks. Last year, he signed a two-year, $4.3 million contract with the Charlotte Hornets. He used an early-termination option to explore free agency. He averaged 11.7 points, 3.2 rebounds and three assists last season. He has averaged 14.2 points and 5.7 assists in his career.

The Nets are now pursuing Jared Dudley and Jamal Crawford. They are also interested in restricted free agents Allen Crabbe, Tyler Johnson and Kent Bazemore.