MIAMI - Bryan Colangelo opted to make the best out of a bad decision.

The Toronto Raptors president and GM sent veteran centre Jermaine O'Neal along with Jamario Moon to the Miami Heat on Friday for veteran forward Shawn Marion and guard Marcus Banks in a deal that had been rumoured for weeks, and comes just days before Thursday's NBA trade deadline.

The roster shakeup was as much about freeing up financial flexibility and ending a partnership that never panned out, as it was about bolstering the lineup of a 21-34 team for a late-season push.

The Raptors, five games behind Milwaukee for the eighth and final Eastern Conference playoff spot, also gave up a conditional draft pick, and receive cash in return.

"I am obviously very familiar with Shawn on both a personal and professional level and feel he will ideally complement our roster and benefit our team in a significant way," Colangelo said in a statement. "As far as his pending free-agent status, this is not a move intended to clear space or predetermine a next move. It will however provide flexibility to both Shawn and the Raptors.

"This is a win-win for both Toronto and Miami and we wish J.O. and Jamario the best," Colangelo added.

O'Neal, a six-time all-star, joined the Raptors amid much fanfare following a trade that sent T.J. Ford and Rasho Nesterovic to the Indiana Pacers.

Toronto hoped to assemble a powerhouse front line with all-star forward Chris Bosh, but O'Neal has been slowed by injuries and he never really meshed with Bosh. With the emergence of Italian centre Andrea Bargnani, chosen first overall in the 2006 draft, O'Neal was suddenly dispensable.

The 30-year-old averaged 13.5 points and seven rebounds for Toronto, but the 6-11 centre missed 14 games with an injury to his right knee, the opposite knee that kept him out of 42 games last season with Indiana.

The trade will give the Raptors some financial breathing room this summer, when Marion's US$17.8-million contract comes off the books, plus the promise of much-needed defence and rebounding at the small forward position.

Marion, who could play Wednesday when the Raptors host the Cleveland Cavaliers, arrives in Toronto on the heels of one of his best games with the Heat.

Thursday night, the 30-year-old who was acquired by Miami just over a year ago from Phoenix for Shaquille O'Neal, took a bounce pass from Dwyane Wade and dunked with 1.1 seconds left to lift Miami to a 95-93 win over the Chicago Bulls.

Marion's versatility earned him the nickname "The Matrix" during his eight seasons with the Suns. He's averaged 12 points and a team-best 8.7 rebounds and started 36 games this season.

Over 10 seasons with Phoenix and Miami, Marion has averaged 17.9 points and 10.0 rebounds. He finished in the top 10 in the NBA in rebounds and steals on seven occasions, and was named a Western conference all-star in 2003, '05, '06 and '07.

The trade frees up significant room under the salary cap this summer for the Raptors to shore up a squad that has been bounced from the NBA playoffs in the first round the last two seasons, and went into this weekend's all-star festivities in Phoenix second last in the Eastern Conference.

The Raptors are also looking ahead to 2010, when Bosh will join a stacked free agent class.

Banks averaged 2.6 points in 16 games with Miami this year, and will battle for playing time at point guard with incumbents Jose Calderon and Roko Ukic. Banks, who makes just under $4.5 million and $4.75 million in 2009-10, might also see some time at shooting guard.

Moon averaged 7.3 points in 54 games with Toronto, and becomes a free agent this summer after making $711,000 this season.