Jalen Rose doesn't have a problem with players being traded in-game like Harrison Barnes because it is part of the business. (1:23)

DALLAS -- Harrison Barnes watched the fourth quarter of the Mavericks' 99-93 win over the Charlotte Hornets on Wednesday from the bench after learning that he was being traded to the Sacramento Kings.

The Kings sent second-year forward Justin Jackson and veteran forward/center Zach Randolph to the Mavs for Barnes.

The official announcement of the trade came after the game, but news of the agreement broke early in the fourth quarter of the Mavs' win. Barnes, who scored 10 points through the third quarter, chose to remain on the bench and support his soon-to-be-former teammates.

Barnes' agent, Jeff Schwartz, told ESPN's Paul Pierce that he and the Mavericks were working on a trade and Barnes knew that something was in the works with Sacramento. The timing was agreed upon during the game, according to Schwartz, and Barnes wanted to play.

"He's a better man than me, for sure," said Dirk Nowitzki, the longtime face of the Mavs who frequently raved about Barnes' character and work ethic. "Everybody else would have bounced. He's just a generally good dude. He's obviously got bonds with some of these players here for life, and that's the kind of guy that he is."

LeBron James took to Instagram on Wednesday to point out the hypocrisy of teams trading players vs. players requesting trades.

"So let me guess this is cool cause they had to do what was best for the franchise right???" James wrote. "Traded this man while he was literally playing in the game and had ZERO idea. I'm not knocking who traded him because it's a business and you have to do what you feel what's best but I just want this narrative to start to get REAL/CHANGE and not when a player wants to be traded or leaves a Franchise that he's a selfish/ungrateful player but when they trade you, release , waive, cut etc etc it's best for them! I'm ok with both honestly, truly am. Just call a ♠️ a ♠️!!"

The post was liked by Anthony Davis, who has been at the center of trade talks for almost two weeks since he requested to be dealt by the New Orleans Pelicans.

The Barnes deal came on the eve of the NBA trade deadline and a week after Dallas' blockbuster with the New York Knicks to acquire Kristaps Porzingis. Rookie star Luka Doncic is the lone regular Mavs starter left after the two deals.

Barnes left the American Airlines Center without talking to the media but did post on social media later Wednesday.

After the game, Mavs coach Rick Carlisle thanked Barnes in front of the team for "being the model professional and a great example."

"I am going to miss him an awful lot," Carlisle said. "We'll miss him an awful lot, but I believe he's going to have a great situation where he's going and we'll just go forward from here."

Mavs owner Mark Cuban took to Twitter later Wednesday to salute Barnes.

You have been first class on the court and off. Your voice and actions in the community have made a difference Thank you HB https://t.co/l3drTkJIgr — Mark Cuban (@mcuban) February 7, 2019

The Kings want to make a long-term play to keep Barnes, who has a player option on his $25 million deal for the 2019-20 season, sources told ESPN.

The 26-year-old Barnes, who led the Mavs in scoring the previous two seasons, is averaging 17.7 points per game this season but is shooting 40.4 percent from the field, the second-worst mark of his seven-year career. He will join a Sacramento team (28-26) on the cusp of a playoff spot in the Western Conference.

"I don't know too much about Harrison," Kings center Willie Cauley-Stein told reporters Wednesday night. "But just from [scouting], he's always on the scouting board. He's a professional, so I'm sure he's going to fit in perfect."

The Kings have been active in the lead-up to the deadline, also agreeing Wednesday to acquire Alec Burks from the Cleveland Cavaliers as part of a three-way deal with the Houston Rockets.

After the deals, Sacramento won't have a player on its roster over the age of 30. Nemanja Bjelica is the oldest and doesn't turn 31 until May.

The deal has significant financial ramifications for Dallas, as it positions the Mavs to be aggressive in free agency this summer, despite taking on the combined $31 million in salary owed next season to Tim Hardaway Jr. and Courtney Lee in the Porzingis deal.

The Mavericks now have $13.1 million in room to use at the trade deadline or up until June 30. They project to have $30 million in room for 2019-20, and that number could increase to $40 million if Dwight Powell opts out of his contract.

The Kings will use their remaining $10.5 million of cap space to acquire Barnes. The small forward has an 8 percent trade bonus in his contract valued at $686,443 (as of Thursday). The cap hit for Sacramento is $24.8 million this season and $25.1 million for 2019-20. The Kings will have $21 million in room if Barnes opts in or $45.2 million if he declines his option.

Information from ESPN's Bobby Marks was used in this report.