Phoenix have the best record in the Western Conference but believe they need a bigger inside presence to battle with the likes of San Antonio's Tim Duncan and the Los Angeles Lakers' newly acquired Pau Gasol.
"We're thrilled to add a player and person of Shaquille's quality to our roster," Suns general manager Steve Kerr said.
"We decided to make this move based on our feeling that it gives us a better chance to succeed in the play-offs, which is what it comes down to...We felt that it was a great opportunity."
Round-up: James' genius beats Celtics
The 35-year-old O'Neal, a four-time NBA champion, played four seasons with the Orlando Magic, eight with the L.A Lakers, and was in his fourth season with the Heat.
This season he has been hampered by fitness problems and has averaged a career low 14 points while missing 14 games due to a nagging hip injury.
"I wasn't going to do this unless I felt really good about it from a medical standpoint, that's why we brought Shaquille in ...to meet with our medical group," Kerr added.
"The reports that I got were really, really good."
The Heat, who have the NBA's worst record at 9-37 and have lost 19 of their last 20 games, are looking to rebuild. They then lost to Detroit after the trade was announced.
"He was not happy in Miami playing for a team that's rebuilding," said Kerr.
"We felt that with our core group here surrounding him, he doesn't have to be the star, he can be one of the guys. But he can be one of our guys who is unlike any of our other guys."
Marion, a four-time All-Star has been with Phoenix throughout his nine-year NBA career and has averaged double figures in scoring in every season.
The trade represents a risk for the Suns who are banking on O'Neal rediscovering his fitness and form.
"We believe this addition strengthens our team," said Kerr.
"We thank Shawn and Marcus for their contributions to our team.
"Shawn in particular has been a tremendous player for this organization the past eight-and-a-half years and his impact both on and off the court in Phoenix will not be forgotten."
Without O'Neal, the Heat's dreadful form continued with the 100-95 loss at Detroit and after the game coach Pat Riley said the trade was for the benefit of the team.
"It was a significant move that we felt we had to make based on where we are right now, what our record is. A lot of thought went into it but I think our players were stunned by it a little bit but they played hard tonight."
Round-up: Jazz on fire
Round-up: Rampant Rasheed