The Boston Celtics have completed their trade Golden State Warriors, receiving two-time All-Star forward David Lee in exchange for Gerald Wallace and Chris Babb.

The teams announced the deal Monday. They agreed to the trade July 7, but Boston needed time to sort out other moves in free agency before acquiring Lee.

Babb was not named in early media reports of the trade. He split time between the Celtics and the Maine Red Claws of the NBA Development League the past two seasons. Babb played in 78 regular-season games with the Red Claws, starting all but four and averaging 13.9 points per game.

Lee, a 6-foot-9 forward/center, was an All-Star in 2010 with New York and 2013 with Golden State. But he injured his left hamstring in the final preseason game in October and his role diminished with the emergence of Draymond Green, the runner-up for defensive player of the year.

Lee played the fewest minutes of his career and averaged just 7.9 points per game last season for the NBA champion Warriors, who were looking to trade Lee to limit the team’s luxury tax hit next season. Lee is due about $15.4 million in the final year of his contract, while Wallace is owed about $10 million next season.

“We are excited to welcome David as a member of the Celtics family,” said Danny Ainge, the Celtics president of basketball operations, in a press release. “His proven skill set and experience on a championship team will add valuable depth to our frontcourt and a veteran presence to our locker room.”

The Warriors believe Wallace could fit in well in their versatile defense, where players routinely switch positions.

The 6-foot-7 forward, who was an All-Star in 2010 with Charlotte, played sparingly for the Celtics last season. Wallace averaged 1.1 points and 8.9 minutes in 32 games – both were career lows, as were his totals for the season of 11 assists, 57 rebounds and 286 minutes.