ESPN NBA Front Office Insider Amin Elhassan discusses why the Grizzlies decided to acquire Mario Chalmers from the Heat in a four-player trade. (3:02)

The Miami Heat announced Tuesday that they have traded veteran guard Mario Chalmers to the Memphis Grizzlies.

In a four-player swap, the Heat sent Chalmers and forward James Ennis to the Grizzlies for guard Beno Udrih and forward Jarnell Stokes.

Chalmers addressed his departure via Twitter:

It has been a tremendous honor and privilege to be a part of the Miami Heat championship family for more than ... https://t.co/HvhnWKjrQN — Mario Chalmers (@mchalmers15) November 11, 2015

League sources told ESPN.com the Heat asked the Grizzlies for more time, after the sides agreed in principle to a trade framework Tuesday, to try to recruit a third team to absorb the contract of either Udrih or Stokes. Then the teams went ahead with a direct deal Tuesday night, after no third team agreed to join in, bringing a culmination to trade talks that had been going on for days.

ESPN.com first reported Nov. 3 that the Heat and Grizzlies had opened serious trade talks centered around Chalmers, with 3-5 Memphis unexpectedly on the hunt for an early season shakeup in the wake of a worrisome start that included a 30-point home loss to Cleveland and a whopping 50-point loss at Golden State.

"This is a tough day for myself and the organization in trading Mario Chalmers and James Ennis," Heat president Pat Riley said in a team statement. "Mario was a part of two championships with us, and Ennis is a solid young player, but it is part of the business, and it was a move necessary to make because of our crowded backcourt. We feel that it is in the best interest of Mario, and we want him to be successful and be a part of a good team. We wish them nothing but the best."

Sources say Miami could elect to keep searching for trades for both Udrih and Stokes as it seeks to further reduce its luxury tax bill. The Heat had made both Chalmers and veteran big man Chris Andersen available via trade in the summer in hopes of ducking out of tax territory.

The Heat would have to trade Andersen as well, without taking significant salary back, to get under the luxury tax and avoid the NBA's dreaded "repeater" penalties for teams that fall in tax territory in consecutive seasons.

Mario Chalmers is headed to Memphis, as the Heat agreed to a four-player trade with the Grizzlies on Tuesday. Mike Ehrmann/Getty Images

The deal struck with Memphis on Tuesday is expected to save the Heat roughly $6 million in tax payments but leave them some $5 million above the league's 2015-16 tax threshold.

Selected No. 34 overall in the second round of the 2008 draft, Chalmers, 29, has spent his entire career with the Heat. He played on two Miami championship teams after winning a title at Kansas. In the Jayhawks' victory over Memphis in the 2008 NCAA championship game, Chalmers helped clinch the win with a 3-pointer in overtime.

"Rio can hold his head high, leaving on a great note here," Heat coach Erik Spoelstra said. "He'll always be remembered as a two-time champion point guard here in Miami [and] welcomed in Miami from here on out."

Chalmers is in the final year of a two-year deal signed in the summer of 2014. He is making $4.3 million this season. He appeals to the Grizzlies not only as a potential backup to Mike Conley but also as a proven 3-point shooter who can help address the Grizzlies' most chronicled weakness. With Chalmers departing South Beach, Dwyane Wade, Chris Bosh, Udonis Haslem and Andersen are the last four players from Miami's latest title in 2013.

"Days like this aren't fun," Wade said. "Rio's a brother."

Chalmers told ESPN.com's Michael Wallace last week that he had come to accept that his future with the club was out of his control.

"It's definitely been tough, but I'm built like that ... for tough moments, to deal with things," Chalmers said. "I've always had the odds stacked against me. That's what made me who I am.

"Especially with the way things have been going, I've got to prove every day why I'm here, why I've got two championship rings, why I was a starting point guard on two championship teams. So I've just got to keep proving myself."

Information from The Associated Press was used in this report.