Luka Doncic scored 45 points in his first game in Dallas since being traded to the Los Angeles, helping the Lakers wrap up a playoff spot with a 112-97 victory over the Mavericks on Wednesday night.

Doncic’s emotional return came two months after a seismic trade out of nowhere that sent the five-time All-Star to Los Angeles. The 26-year-old star from Slovenia spent his first 5 1/2 seasons with the Mavericks, and still had two seasons left on his contract.

The 45 points matched Doncic’s season high — he did that once for Dallas and one other time for the Lakers. He also had eight rebounds, six assists and four steals.

LeBron James had 13 of his 27 points in the fourth quarter, when the Lakers fell behind before a strong finish.

James’s three-point play with 8:10 left broke an 87-all tie and put the Lakers ahead to stay, and he added a layup 34 seconds later. That came after Dallas’ 15-2 run.

Anthony Davis, who went from the Lakers to Dallas in the Doncic heal, had 13 points and 11 rebounds. Naji Marshall led the Mavs with 23 points and eight assists.

The Lakers remained third in the Western Conference standings after their third game in four days. They came to Dallas after splitting a pair of games at Western Conference-leading Oklahoma City.

Dallas (38-42) is guaranteed a losing record a year after making the NBA Finals. The Mavs are still in position to finish 10th and make the play-in tournament.

Magic 96, Celtics 76 >> Franz Wagner scored 23 points, Cole Anthony came off the bench with 18 points and Orlando beat visiting Boston to clinch seventh place in the Eastern Conference and the top spot in the play-in tournament.

Baylor Scheierman and Payton Pritchard scored 15 points each to lead the Celtics, who did not use their top six players and made 7 of 40 3-point shots. Jayson Tatum, Jaylen Brown, Kristaps Porzingis, Derrick White, Jrue Holiday and Al Horford did not play for the Celtics.

Paolo Banchero had 15 points and six assists for the Magic. It was Wagner’s 12th straight game of scoring 20 or more points.

The Celtics are locked into the No. 2 spot in the Eastern Conference playoffs and played a day after an overtime win against New York. The 76 points was a season-low for Boston, well under the previous low of 92 points they scored at Oklahoma City on Jan. 5.

Raptors 126, Hornets 96 >> Jonathan Mogbo had 17 points, a career-high 11 assists and 10 rebounds for the first triple-double by a rookie in the NBA this season, helping Toronto beat short-handed Charlotte.

Jared Rhoden scored 23 points in the Raptors’ ninth straight home victory over the Hornets. Scottie Barnes added 17 points and 11 rebounds as the Raptors finished 18-23 at home.

AJ Lawson scored 14 points and the Raptors matched their biggest margin of victory this season. Toronto also had a 30-point win at Brooklyn on March 26.

76ers 122, Wizards 103 >> Jeff Dowtin Jr. scored a career-high 30 points and Philadelphia snapped a 12-game losing streak with a victory at Washington.

Lonnie Walker IV had 24 points for the 76ers, who won despite a lengthy list of injured players that included Joel Embiid, Paul George, Eric Gordon, Kyle Lowry, Tyrese Maxey, Jared McCain and Andre Drummond.

Dowtin, a Washington, D.C.-area native on a two-way contract for Philadelphia, played for the 76ers for the first time this month. He went 11 of 15 from the field and made four 3-pointers, surpassing his previous career high of 24 points from March 14 against Indiana