Tyrese Maxey tossed in a game-high 40 points and rookie VJ Edgecombe got off to a historic start with 34 to lead the visiting Philadelphia 76ers to a 117-116 victory over the Boston Celtics on Wednesday night in the season opener for each team.

Boston trailed 117-116 after Edgecombe missed two free-throw attempts with 8.5 seconds left, but Payton Pritchard missed two shots on the Celtics’ final possession.

Edgecombe, the third pick in this year’s NBA draft, rang up the third-most points in an NBA debut all time and the most since Wilt Chamberlain totaled 43 on Oct. 24, 1959. He also had seven rebounds and three assists.

The old Sixers record for the most points by a player in his first game was 30, set by Allen Iverson on Nov. 1, 1996, vs. the Milwaukee Bucks.

Boston received 25 points from both Derrick White and Jaylen Brown. The Celtics were 11 of 43 from 3-point territory.

Philadelphia’s Joel Embiid was on a minutes restriction and had four points and six rebounds in 20 minutes. Embiid, who was 1 of 9 from the field, had arthroscopic surgery on his left knee in April.

The Celtics led 28-26 after one quarter but Philadelphia had a 57-51 halftime lead. Maxey, who made 7 of 9 3-point attempts for the 76ers, scored 19 of his 40 points in the second quarter. Boston was 5 of 23 from 3-point range in the first half.

The Celtics took their first lead of the second half on a Sam Hauser 3-pointer that made it 62-61 with 8:06 remaining in the third. Hauser’s 3 was part of a 16-0 run that put Boston up 72-61 with 5:14 left in the third.

Boston outscored Philadelphia 35-18 in the third and carried an 86-75 advantage into the final 12 minutes.

The Celtics had their largest lead, 88-75, following a Brown jumper with 11:10 to play, but Philadelphia was within two points after an Edgecombe basket with 7:56 left. Boston had a 109-100 edge with 3:47 remaining.

Philadelphia took its first lead in the fourth quarter on a Kelly Oubre Jr. 3-pointer that put the 76ers up 112-111 with 1:16 left.