Free agent Dwyane Wade has committed to joining the Chicago Bulls.

“This was not an easy decision, but I feel I have made the right choice,” Wade said in a letter released to the Associated Press.

“He’s home,” one source close to Wade said of the Chicago native.

“Watching the Bulls growing up inspired me at an early age to pursue my dream of becoming a basketball player,” Wade said in his letter. “My most treasured memories were watching my dad play basketball on the courts of Fermi Elementary School and developing my game at the Blue Island Recreation Center. I have never forgotten where I came from, and I am thankful to have an opportunity to play for the team that first fueled my love of the game.”

Wade has agreed to a two-year deal worth $47 million, according to the AP. The Miami Heat, Wade’s team for his entire 13-year career, had a two-year, $40 million offer on the table for him.

Extreme acrimony had been building between Wade and the Heat over the past week. Wade met with Heat owner Micky Arison in New York on Monday.

“Miami dared a very proud man to go home, and that man’s best friend [LeBron James] just won a title by going home,” a source very close to the process told ESPN’s Ramona Shelburne.

Arison took to Twitter late Wednesday to thank Wade for his 13 years with the Heat.

After Wade and the Heat failed to reach an accord Monday, the Bulls picked up their intensity in attempting to trade players, sources said. Wade and the Bulls entered serious negotiations late Wednesday after he held free-agent meetings during the day with several teams, sources said. The Bulls had ramped up efforts to clear needed space to give Wade the multiyear deal he has been seeking.

A source told ESPN’s Chris Broussard that Jimmy Butler had a phone conversation with Wade in which he recruited him. Wade and Butler, who are both Marquette products, are looking forward to playing together, according to the source.

Wade also considered Milwaukee because of the Marquette connection, the source told Broussard, but the Bucks couldn’t get near Wade’s asking price of 2 years, $50 million.

The Bulls had been gaining momentum on landing Wade and believed they had a trade partner willing to take on Jose Calderon to clear salary-cap space, sources told ESPN.com.

The Los Angeles Lakers have swooped in ahead of the Brooklyn Nets to acquire Calderon, according to league sources Wednesday. Calderon and two future second-round picks are headed to Los Angeles in exchange for a player to be named later, the sources said.

Calderon seemingly was headed to the Nets, but sources say Chicago informed Calderon’s representatives that they are trading him to L.A. instead.

The Bulls have also agreed to a trade that will send Mike Dunleavy to the Cleveland Cavaliers, according to sources.

James has long coveted Dunleavy as a teammate, a source said.

Calderon became a focus of trade talks because he is in the final year of a contract that pays him $7.7 million.

With the Bulls sending Calderon to the Lakers, according to sources, Chicago clears the way to create more than $20 million and beat the Heat’s offer for Wade.

Shipping Dunleavy out removes the $4.8 million he was slated to earn this season.

The richest offer for Wade had been from the Denver Nuggets, who offered him $52 million over two years. Wade met with the Nuggets on Wednesday.

Wade has told friends if he ever left Miami, where he has played 13 seasons and won three titles, it would be to play for his hometown Bulls, sources said.