The Sixers gathered for one final timeout, because nothing would come easy on this night.

Joel Embiid had overcome a slow start to notch a 36-point night. His team had flipped a 17-point hole into a 10-point advantage with less than three minutes to play. Yet a last-ditch outburst by young Sacramento Kings star Tyrese Haliburton — including an off-balance corner three-pointer that cut the Sixers’ lead to two with 11.1 seconds to play and a five-second violation on the home team’s ensuing possession — put a Saturday night crowd that had braved snowy conditions to be in attendance on high alert.

But Harrison Barnes’ last-second three-pointer clanked off the side of the rim, and the Sixers completed their rally and survived, 103-101, at the Wells Fargo Center.

“Coach Doc made a valid point when he came into the locker room after the game [that] every night’s not gonna be your night,” said point guard Tyrese Maxey, who finished with 13 points and seven assists. “Guys are gonna hit shots. It’s the NBA, so everybody’s talented, everybody’s skilled. That team plays free and they play at a fast pace. ...

“Basketball’s always been a game of runs at any level, honestly. We kept saying, ‘weather the storm.’ Danny Green kept saying, ‘Cut it by six before this timeout. Cut it by eight by this timeout. OK, boom, take the lead. Go up four right here. Just little nuggets like that [are] the game within the game.”

The Sixers (30-19) have now won 14 of 17 games to move into a tie for third place in the Eastern Conference. Yet Saturday night was more of a struggle than many would have perceived entering the contest.

Sacramento (18-33) entered Saturday with five losses in a row and were playing without standout guard De’Aaron Fox. But the Sixers avoided disaster in a clunker wedged between Thursday’s win against the always-intriguing Lakers and Monday’s upcoming game against the scorching Grizzlies.

However, Saturday’s outing served as a cautionary tale on how the Sixers can flounder when Embiid is not dominant. He started the game 1-of-6 before a 17-point third-quarter explosion to anchor the Sixers’ comeback. It was also a warning about what can unfold when the Sixers’ normally sound ballhandling goes sideways, as it did at times, leading to the Kings scoring 22 points off 18 Philly turnovers.

The Sixers made their charge in the third quarter, erasing the Kings’ 70-55 lead built when Haliburton swiped a pass and threw down a one-handed dunk. Back-to-back three-pointers by Green and Georges Niang sliced that deficit to 79-76, before Embiid finished inside and then spun and converted through contact for an and-one and then made the free throw that tied the score at 81 in the period’s final minute.

Sacramento briefly rebuilt a six-point lead with Embiid and Tobias Harris on the bench early in the fourth. But the Sixers promptly answered, with an Andre Drummond finish giving them their first lead since the opening minutes at 88-87, before a Maxey transition bucket and three-pointer stretched that advantage to 93-87 with about six minutes to play.

Embiid, who has scored at least 30 points in 17 of his past 20 games, went 10-of-18 from the floor and 14-of-18 from the free-throw line and totaled 12 rebounds and six assists.

Haliburton scored a career-high 38 points on 11-of-19 shooting and added seven assists and three steals for the Kings.

Slow start, frenetic finish

The Sixers looked a step slow from the opening tip, trailing by as many as 17 points late in the second quarter when Marvin Bagley III followed a finish underneath with a baseline jumper to make the score 50-33.

The struggle stemmed from two uncharacteristic roots.

The Sixers committed 13 first-half turnovers that the Kings converted into 18 points. Those miscues also helped Sacramento take 13 more shots in the first half.

Embiid, meanwhile, went just 1-of-5 from the floor before the break, though he did manufacture 10 points on 12 free-throw attempts. When asked before the game about defending Embiid, Kings interim coach Alvin Gentry said his team would need to throw a bunch of different looks at the MVP contender. Multiple defenders constantly swarmed Embiid, helping lead to three assists before the break but also contributing to three turnovers.

The barrage of easy looks in transition helped the Kings shoot 51.1% from the floor and 8-of-18 shooting from three-point land in the first half.

The Sixers trimmed that deficit to 11 before the break, and then to 62-55 early in the third on an and-one finish and free throw by Embiid before their extended rally and wild finish.

A key to Embiid’s turnaround, Rivers said, was to move him to different spots so that he could identify from where the traps were coming.

“It wasn’t a game for him to be on the post tonight, because of the way they were trapping every play,” Rivers said. “It was more elbows and rolls. ... I thought early on he was trying to create it too much, and during a timeout I said, ‘Hey, just take your time, read it, and we’re gonna be good.’ I thought he did that more from the second quarter on.”

Added Embiid: “Obviously, they doubled and tripled me all over the floor. Whether I was in the post or at the three-point line, they were just coming and coming and coming. I think the difference in the second half was just get deeper position and just attack off the dribble.”

As for Haliburton’s late flurry? Green’s exhaled: “Whoo” said it all.

“That side-step, step-back fadeaway over the backboard in the corner,” Green said, “Yeah, I thought that was, for sure, gonna come off hard. It didn’t touch anything but the net and that showed what kind of night he had.”

Harris stays efficient

A positive of a sporadic night was that Harris continued his steady offensive streak. He finished with 16 points on 7-of-12 shooting from the floor to go along with eight rebounds.

Harris entered Saturday averaging 23 points on 58.4% shooting , including 57.1% from three-point range, in his previous five games, while also contributing 7.6 rebounds, 3.8 assists, and 1.8 steals in those outings.

He accumulated nine quick points on 4-of-5 shooting. He did not get as many touches in the second half, but converted a finish off a feed from Embiid to reduce the Kings’ lead to 77-69 late in the third before muscling in a crucial crunch-time and-one that extended the Sixers’ lead to 99-90 with less than four minutes to play.

Curry’s return

Curry struggled in his return to action after missing the previous four games with ankle soreness. He finished with eight points on 3-of-10 shooting, with five assists and two turnovers.

He appeared to catch some early rhythm when he stepped into a transition three-pointer at about the 7-minute mark of the first quarter and then followed with a game-tying baseline jumper. But he missed his next three shots in the first half, and misfired on three open three-pointers in the second half. He did, however, bury a key shot from behind the arc that cut the Kings’ lead to 87-84 with about 10 minutes to play.

Despite the shooting woes, Rivers said he “loved” Curry’s approach — particularly after Saturday’s snowstorm forced the Sixers to cancel shootaround.

“He literally hasn’t been in any team activity, and I thought he kind of just let the game just come to him instead of trying to force action,” Rivers said. “He kind of let it come, he got his wind, got his rhythm and then he started playing. I thought that was very smart.”

Curry’s return, combined with Green and Matisse Thybulle coming back from injury earlier this week, gave Rivers his fullest complement of players in some time. He played 11 Sixers total, including an all-bench lineup of Green, Drummond, Niang, Furkan Korkmaz, and Charlie Brown to start the second quarter, though that group lasted less than two minutes before Rivers quickly subbed in Curry and Maxey.

Late in the third, Rivers then inserted second-year guard Isaiah Joe, who is known as a dangerous outside shooter but has also developed into a reliable defender. Rivers kept Curry and Maxey on the floor with Green, Niang, and Drummond to start the fourth, then put Joe in for the final defensive possession.

The Sixers compiled 22 bench points, led by 11 from Green on 4-of-5 shooting, including 3-of-4 from three-point range.