The Lakers also received a future first-round pick and a 2015 second-round pick in the deal, sending the rights to center Sergei Lishchuk to Houston.
"This trade allows us to acquire a solid player who will make us a better team, as well as draft picks to improve our team in the future, while at the same time allowing us to maintain financial flexibility," Lakers general manager Mitch Kupchak said in a statement. "In addition to what he'll bring us on the court, we think Jeremy will be warmly embraced by our fans and our community."
Lishchuk played last season for Velencia of the Spanish League. He was drafted by the Grizzlies in 2004 and traded to the Rockets in 2008 before he was acquired by the Lakers in 2010 as part of a three-way trade with the Nets and Rockets.
Lin will make about $15 million this season in the last year of a deal that counts only $8 million against the cap.
He earned his big contract with the Rockets thanks to a fantastic midseason run with the New York Knicks in 2012, when the "Linsanity'' phenomenon was born.
He's the kind of dynamic, shoot-first point guard that has become more and more popular in the league over the last few seasons, which should help the Lakers, who have pass-first Kendall Marshall and the oft-injured Steve Nash on the roster as well.
Lin averaged 12.5 points and 4.1 assists last season, but he lost his starting job alongside the defensively deficient James Harden because coach Kevin McHale preferred Patrick Beverley's tenacity on that end of the floor.
The Associated Press contributed to this report.