Paolo Banchero stole this game — and Egor Dëmin’s glory.

The Magic star beat the buzzer, and a replay, and ultimately the Nets with his last-ditch heave.

It turned what looked like a thrilling rally into a 104-103 overtime heartbreaker before 16,916 stunned fans at Barclays Center on Wednesday night.

Brooklyn Nets forward Michael Porter Jr. (17) takes a shot during the first half against the Orlando Magic.Michael Porter Jr. shoots a jumper during the first half of the Nets’ 104-103 overtime loss to the Magic on Jan. 7, 2025 at Barclays Center. Robert Sabo for NY Post

“Give credit to Paolo,” Nets coach Jordi Fernández said. “Amazing player, and amazing players make amazing shots.”

The same could’ve been said first of Michael Porter Jr., then Dëmin.

Porter poured in 34 points on 12-for-24 shooting — including 8-for-18 from behind the arc, tying his career high for 3-pointers. Dëmin was scoreless through three quarters but took over down the stretch, with 18 points on 5-for-5 from deep in the fourth and OT.

“That was one of those moments when in high school or when I was a kid, I was shooting alone in the gym and thinking about moments like this,” Dëmin said. “Going through things like I’m hitting the game-winning shot, five 3s in a row or whatever; this was one of those moments I was manifesting when I was a kid. So it felt really good. But we didn’t get a win, so it doesn’t really matter.”

Of course, Dëmin essentially is still a kid in NBA terms. A 19-year-old rookie, he’s shown a fortitude beyond his tender years. This isn’t the first time he’s shaken off a subpar outing to have a clutch endgame.

There was his equalizer with 5.6 seconds left in regulation to force bonus basketball. And then banking in a go-ahead dagger with 5.3 seconds left in overtime.

“That’s not the first time he’s done [this], when it’s been a close game in the fourth and he’s made super timely shots. That’s the signs of a big-time player,” Porter said. “He has confidence in himself. And when you put the type of work in that he does, you can go scoreless for 3 ½ quarters and then hit the biggest shots of the game. So I was proud of him for staying with it and giving our team a chance to win.”

Dëmin’s last 3-pointer looked destined to be the winner. Until Banchero turned destiny around with his buzzer-beater, a 26-foot pull-up bank shot.

Follow all the basketball buzz in Brooklyn

Sign up for Inside the Nets by Brian Lewis, exclusively on Sports+.

Thank you

The Magic star finished with 30 points and 14 rebounds.

Brooklyn trailed by as many as 18, and 87-73 after a Banchero bucket with 5:58 left in the fourth. But the Nets closed regulation on a 20-6 run.

Dëmin’s first basket pulled the Nets within 91-88 with 1:46 to play, and after Ziaire Williams — who got a start for Terance Mann — stole the ball, Noah Clowney (10 points, two steals, two blocks) cut the deficit to just one with a minute to play.

Clowney hit what he thought was a tough shot through contact, but it got waved off for offensive interference by Day’Ron Sharpe. The play was reviewed and upheld, and after the Nets fell asleep on defense, Tristan da Silva got free for a dunk with 16.8 seconds left.

But Sharpe made amends by rebounding a Porter miss and kicking out to Dëmin for a tying 3-pointer with five seconds left in regulation. Porter’s defense on Banchero forced a last-second miss and earned them overtime.

Brooklyn Nets player Egor Demin dribbles the basketball.Egor Dëmin looks to pass during the first half of the Nets’ overtime loss to the Magic. AP

Dëmin’s 3-pointer put Brooklyn ahead 100-99 with 1:07 left in the extra stanza, but Banchero found Wendell Carter for a dunk that put Orlando back out in front with 16.2 seconds left. Dëmin banked in a go-ahead bucket the Nets thought was the winner.

Until Banchero snatched Dëmin’s moment.

The Nets (11-23) stayed fifth in the lottery standings, two games behind Washington and percentage points ahead of Utah.

Dëmin’s three 3s in overtime set the Nets team record, and tied the most by an NBA rookie joining Tyler Herro, Brandon Knight, Walter Herrmann, LeBron James and Carmelo Anthony.

The Nets committed to both Tyrese Martin and Jalen Wilson before Wednesday’s salary guarantee deadline, league sources told The Post.

Nic Claxton returned after missing two games for personal reasons but came off the bench, with Sharpe starting. Mann took a DNP.

“It’s just a matter of having a lot of players performing well, giving looks at different roles for different players,” Fernández said of Mann. “He’ll be back. It’s just a matter of me just seeing those roles and seeing those minutes. That’s it.”