Joel Embiid had 23 points, 15 rebounds and six assists and the 76ers beat the visiting Miami Heat 105-104 on Wednesday in an Eastern Conference play-in game.

With the victory, Philadelphia secured the seventh seed in the East and will face the second-seeded New York Knicks in a first-round series beginning on Saturday.

The Heat, who made last season’s NBA Finals as a play-in team, will face an elimination game Friday against the Chicago Bulls for the eighth seed and the right to play the NBA-best Boston Celtics.

Embiid’s availability against Miami was uncertain after the reigning league MVP tweaked his surgically repaired left knee Friday and sat out the regular-season finale two days later.

He played 38 minutes and stepped up down the stretch with eight points in the final three minutes and dished out a clutch assist.

With the game tied at 96, Embiid found Kelly Oubre Jr. under the basket with 36 seconds to play, and he was fouled while making a layup for a three-point play to put Philadelphia ahead for good.

On Miami’s next possession, Nicolas Batum blocked Tyler Herro’s potential game-tying 3-point attempt.

Batum provided a spark off the bench with 20 points and hit five of his six 3-pointers after halftime to help Philadelphia battle back from a 12-point deficit at the break.

Tyrese Maxey added 19 points for a 76ers team that made 21 of 23 free throws.

Both Herro and Jimmy Butler struggled with their shots for the Heat, who led by as much as 14 late in the second quarter.

Butler injured his right knee in the first quarter and said after the game that he would need an MRI, putting his availability for Friday in question.

Herro finished with a game-high 25 points but was just 4 of 14 from 3-point range, while Butler had 19 points on 5-of-18 shooting.

White erupts for career-high 42 in Bulls’ win

Coby White scored a career-best 42 points on 15-of-21 shooting and Nikola Vucevic added 24 points and 12 rebounds as the Chicago Bulls rolled to a 131-116 win over the Atlanta Hawks.

White, who surpassed his previous career high of 37 points, had nine rebounds and six assists as Chicago advanced to a Friday matchup at Miami for the No. 8 seed in the Eastern Conference.

DeMar DeRozan had 22 points and nine assists and Ayo Dosunmu added 19 points on 8-of-12 shooting after missing the final four regular-season games with a bruised right quadricep.

The Bulls shot 56.8 percent from the field and 42.3 percent (11 for 23) from 3-point range to go with a 47-34 rebounding advantage.

Dejounte Murray led the Hawks with 30 points and Trae Young and Clint Capela each had 22 as Atlanta’s season came to an end after it closed the regular season with six straight losses.

The Hawks were within 88-85 but Vucevic’s 3-pointer ignited a 17-2 run to put the Bulls up 105-87 with 1:27 left in the third quarter.