Donovan Mitchell scored 39 points, Caris LeVert added 15 and Cleveland avoided a potentially franchise-shifting loss by rallying for a 106-94 win over the Orlando Magic on Sunday in Game 7 to advance in the Eastern Conference playoffs.

The Cavs trailed by 18 in the first half and were in danger of being eliminated early for the second year in a row — a scenario that may have led to firings.

But Mitchell, who scored 50 in a Game 6 loss at Orlando and has been battling a left knee injury for months, put the Cavs on his back. He carried them past an up-and-coming Orlando team whose playoff inexperience showed in the second half.

“I don’t mean this disrespectful, but it doesn’t really mean much,” Mitchell said. “We didn’t come in just to win the first round. We accomplished one goal, now we have to do it again. That’s the mindset.”

According to the NBA, Cleveland’s comeback is the largest in a Game 7 since the league began tracking play-by-play in 1997-98.

Evan Mobley grabbed 16 rebounds and Darius Garland hit a critical 3-pointer — after getting a pep talk from Mitchell — in the fourth for Cleveland, which won its first playoff series without LeBron James since 1993.

The Cavs will begin the second round on the road against the top-seeded Celtics in Game 1 on Tuesday. Boston went 2-1 against Cleveland this season.