BOSTON — Terrence Ross had 26 points, Nikola Vucevic added 25 points and 12 rebounds and the Orlando Magic rallied past the Boston Celtics 116-108 on Sunday night to clinch their first playoff berth in seven years.

Evan Fournier added 24 points for Orlando (41-40), which last made the postseason during the 2011-12 season. Sunday’s victory also gave the Magic their first regular-season sweep over Boston since 1996-97.

Even with the loss, the Celtics (48-33) clinched at least the fourth seed and home-court advantage in the first round of the playoffs just before tip-off. That came courtesy of Brooklyn’s win over Indiana.

Kyrie Irving had 23 points for Boston. Al Horford finished with 18 points and Gordon Hayward added 16 off the bench.

The Magic erased a 13-point first-half deficit and took an 83-78 lead into the fourth quarter. They kept it going, starting the final period on an 11-2 run, which included nine points by Ross.

Boston responded with run of its own and tied the game at 106 on a 3-pointer by Irving with 2:50 remaining.

The Magic kept attacking.

Fournier got free in the lane and dunked over Terry Rozier to put the Magic back in front. The Celtics turned it over on their next possession. That was followed by an Aaron Gordon layup on the other end that made it 110-106.

Celtics Coach Brad Stevens said before the game that the Indiana outcomes wouldn’t affect how much he played his starters against Orlando. But there clearly was interest in Boston’s locker room beforehand, as evidenced in the television tuned to the Pacers-Nets matchup.

As for his rotations, Stevens was true to his word and played his starters their normal minutes.

It proved costly.

Jayson Tatum limped off the court at the six-minute mark of the first quarter with a left shin contusion and did not return.

Marcus Smart left with 6:15 remaining in the third, helped off by trainers and holding his left side after banging hips with Vucevic. He was diagnosed with a left hip contusion.

Stevens will almost certainly rest both during Tuesday’s regular-season finale at Washington.

NETS 108, PACERS 96: D’Angelo Russell scored 20 points and Joe Harris added 19, leading Brooklyn to a win at Indianapolis and back into the NBA playoffs for the first time in four years.

It’s also the first time since 2014-15 the Nets have not posted a losing record.

Domantas Sabonis finished with 17 points and 12 rebounds to lead the Pacers.

RAPTORS 117, HEAT 109: Pascal Siakam had 23 points and 10 rebounds, Kawhi Leonard scored 22 points and host Toronto beat the Heat in overtime, further denting Miami’s fading playoff hopes.

Norman Powell matched his season high with 23 points as Toronto won its fourth straight over the Heat.

Dwyane Wade scored 21 points for the Heat, who have lost a season-high four straight.

SPURS 112, CAVALIERS 90: LaMarcus Aldridge had 18 points and 13 rebounds as San Antonio – in a three-team scramble to determine playoff seeding in the Western Conference – extended the Cavaliers’ losing streak to nine games with a win at Cleveland.

The Spurs had already clinched a postseason spot for an NBA record-tying 22nd year in a row, but don’t yet know who they’ll play in the first round.

HORNETS 104, PISTONS 91: Kemba Walker scored 20 of his 31 points in the first half to help the Hornets build a big lead and Charlotte went on to win at Detroit.

Charlotte (38-42) has won three straight to cling to its chances of rallying for a playoff spot in the Eastern Conference, while the Pistons (39-41) have lost four in a row to possibly plummet from being a sixth-seeded team to missing the postseason.

THUNDER 132, TIMBERWOLVES 126: Russell Westbrook had 27 points, 10 rebounds and 15 assists as Oklahoma City won in Minneapolis.

Paul George also scored 27 points as the Thunder remained a half-game ahead of San Antonio for seventh place in the Western Conference.

ROCKETS 149, SUNS 113: James Harden scored 30 points in just three quarters as Houston broke its NBA record by making 27 3-pointers in a win at home.

Eric Gordon led the 3-point brigade by tying a career high with eight. Harden had five.

MAVERICKS 129, GRIZZLIES 127: Salah Mejri scored a career-high 19 points, including the tying basket in regulation and the first seven points of overtime as Dallas defeated host Memphis.

Mejri, who had nine rebounds and four blocks, was 7 of 12 from the floor and made a pair of 3-pointers. Trey Burke led the Mavericks with 24 points, 14 in the fourth quarter and overtime.

BUCKS 115, HAWKS 107: Giannis Antetokounmpo scored 30 points and Khris Middleton added 21 to send Milwaukee to a methodical victory at home, giving the Bucks 60 wins in a season for the first time since 1981.

The Bucks, who have clinched the best record in the Eastern Conference, led from the outset as the Hawks rested leading scorers John Collins and Trae Young.

KNICKS 113, WIZARDS 110: Mario Hezonja scored a career-high 30 points and made the go-ahead 3-pointer with 44 seconds left, and New York beat Washington at home for the first time in six years.