The Atlanta Hawks, Boston Celtics and Brooklyn Nets agreed to a three-team deal Tuesday night that saw the Celtics send center Kristaps Porzingis to Atlanta the No. 22 overall pick in Wednesday’s NBA Draft wind up in Brooklyn, sources told ESPN’s Shams Charania on Tuesday night.

In totality, Porzingis and s second round pick will wind up in Atlanta; the No. 22 overall pick and guard Terence Mann going to Brooklyn; and forward Georges Niang and a second round pick going to Boston.

It was the second significant trade in less than 24 hours for the Celtics, who sent Jrue Holiday to the Portland Trail Blazers for Anferee Simons and two second round picks late Monday evening. Across those two deals, according to ESPN’s Bobby Marks, the Celtics saved $180 million in luxury taxes on what was originally projected to be a more than $500 million combined payroll and tax bill next season.

Boston is now below the second luxury tax apron, and could have a path to getting out of the luxury tax entirely this season. Cost-cutting measures were expected to be in play this summer for the Celtics in the wake of Jayson Tatum’s Achilles tear in the second round of the playoffs against the New York Knicks, with the new ownership group likely to have its purchase of the team go through sometime in the next few weeks.

Porzingis, meanwhile, is coming off two strong seasons in Boston, including shooting a career-best 41.2% from 3-point range while averaging over 19 points per game. Assuming he’s over the illness that caused him to shuttle in and out of the lineup over the final few months of the regular season and Boston’s playoff run this past spring, he should slot in nicely in Atlanta’s frontcourt alongside Jalen Johnson, Onyeka Okongwu and last year’s No. 1 overall pick, Zaccharie Risacher.

The Hawks also could potentially have massive salary cap space next summer by moving on from Mann’s $15.5 million salary for each of the next three years. Porzingis is on a $30 million expiring, and could potentially have a long-term future with the Hawks, while All-Star guard Trae Young has a player option and guard Dyson Daniels – last season’s Most Improved Player – also is up for a contract extension this summer.

For Brooklyn, the price of taking on the final three years of Mann’s contract from Atlanta was getting the No. 22 pick in the draft from the Hawks, which originally was the Lakers’ selection and came to the Hawks as part of last summer Dejounte Murray deal with the New Orleans Pelicans.

Brooklyn now has five selections in Wednesday’s first round: Nos. 8, 19, 22, 26 and 27. It also still has plenty of salary cap space left over this summer, and because the Nets are using cap space to make the deal, it cannot be official until the new league year begins on July 6.