The Sacramento Kings came into the Wells Fargo Center Friday night with two wins in their last eight games, on the second half a back-to-back after losing at the Boston Celtics Thursday night.

So the 76ers had this one, right? A tune-up for Sunday’s much-anticipated game at the Milwaukee Bucks, right? A win that would them back into third pace in the Eastern Conference standings, right?

Apparently, someone forgot to tell the Kings.

The Sixers eventually did get the win. But Sacramento sure did make them work for the W. It took a late fourth-quarter run for them to prevail, 123-114.

Jimmy Butler finished with a game highs of 22 points, 7 assists and 2 steals to go with 6 rebounds, 1 block, and 3 turnovers.

“It wasn’t just scoring the ball,” JJ Redick said of his teammate. “It was driving. It was creating havoc, just a level of aggression.”

Similar things can be said about Joel Embiid, who added 21 points and game highs of 17 rebounds and 4 blocks. He also had 4 turnovers.

The victory moved the Sixers (44-25) back into third place with 13 games remaining. The top four seeds in the Eastern and Western Conference receive home-court advantage in the opening round of the playoffs. Meanwhile, the Sixers snapped their three-game series losing streak to the Kings (33-35).

They achieved their goal of getting the third seed in last season’s playoffs. A third seed will help the Sixers avoid a possible four/five opening round matchup against the Celtics. Since the start of the 2014-15 season, the Sixers are 3-21 against the Celtics, including a conference semifinals series setback in May.

Sixers coach Brett Brown downplayed the importance of acquiring a third seed on Friday.

“One, playing at home is priceless,” Brown said. “Two, trying to preconceive who does that equal – you are going to play so-and-so or you are going to play somebody else. You don’t really know that.

“So to overthink we have to get to third in my opinion is a mistake.”

He’s thinks it’s about a team’s health, spirit and if it is playing good basketball heading into the postseason more so than a seeding.

This was one of Butler’s best performances throughout a game as a Sixer. The swingman had 14 points in the first half, with 12 coming in the second quarter. Then he split 8 points evenly between the third and fourth quarters.

“I think everyone was comfortable,” said Butler, who made 8 of 14 shots and graded out a game-best plus 20. “We realize how important each and every single one of these games is down the stretch. It’s time to take it up a notch or two.”

The Sixers want Butler to be more like the player they acquired from the Minnesota Timberwolves in a multi-player trade in November. Back then, the four-time All-Star was a ball-dominant player, who took over games.

As a Sixer, he’s deferred to teammates for most of the game before being more aggressive in fourth quarters.

“I want to him to put his thumbprint on a game more,” Brown said. “That’s my job, too. That’s not something I just lob out a comment without some level of ownership from my side. I think somewhere in the middle we hope to meet and grow this as I said a lot.”

At times, the coach respects Butler’s desire to be a playmaker and make the right play instead of being selfish with the ball. But Brown knows it’s on him to find ways to get more out of the four-time All-Star. He wants to put him in better situations.

Brown believes those things might be the No. 1 on his mind as the squad gets closer to the postseason.

That’s because “we will not be as good as we can be without him,” the coach said. “We really need him to be Jimmy Butler and I need to help him.”

But for now, Butler will tell you that he’s been doing what’s been asked of him for the most part.

“Play with a little bit a of energy, guard, gamble a lot,” he said.

Butler added that he’s messed up on those gambles the majority of the time. But he’s having fun.

“It’s definitely fun to win,” he said. “But it’s fun when everybody’s playing like that."

The Sixers shot 50.5 percent from the field and made 24 of 27 foul shots. They also only committed 11 turnovers after producing 22 in Tuesday’s game against the Cleveland Cavaliers.

This marked the second straight game and 16th time this season that all five starters finished in double figures. JJ Redick and Tobias Harris each had 19 points, while Ben Simmons added 18. Reserve center Boban Marjanovic added 12 points.

The Sixers clung to a 116-112 lead with 3 minutes, 38 seconds remaining after Harrison Barnes’ three-pointer. But JJ Redick hit a three-pointer to put the Sixers up seven. That lead didn’t last long, as Willie Cauley-Stein scored on a cutting dunk to close the gap to 119-114 with 2;35 to play.

But Embiid came up with three huge plays that helped the Sixers win.

The two-time All-Star center stole the ball near the Kings baskets with 2:03 left. Then on the ensuing possession, his turnaround jumper gave Philly a 121-114 advantage. Moments later, he grabbed a defensive rebound of De’Aaron Fox’s missed 10-footer.

Then after Embiid grabbed the defensive rebound on Buddy Hield’s missed three-pointer, Butler’s jumper with 50 seconds left gave the Sixers a nine-point cushion.

Fox and Barnes paced the Kings with 16 points each.

This was Corey Brewer’s first game back in Philadelphia after having two consecutive 10-day contracts with the squad earlier this season. The Kings reserve guard’s second 10-day deal expired on Feb. 4, which was ironically two days after the Sixers faced the Kings in Sacramento.

At that time, the Sixers had to decide between signing him for the remainder of the season or release him.

The Sixers opted to release him before acquiring Harris, Marjanovic, Mike Scott, Jonathon Simmons and James Ennis on Feb. 7 in trades.

Brewer signed his first of two 10-day contracts with the Kings on Feb. 8. Sacramento signed him for the remainder of the season on Feb. 28.

“We were in talks. I thought I had a chance coming back here, coming back to Philly,” Brewer said. “I would have loved to come back. But they made some trades. I knew if they made a couple of trades at the deadline, then I couldn’t come back. That’s what happened. I ended up at the trade, the next best thing was to go to Sac.”

Meanwhile, this was Nemanja Bjelica’s first trip to Philly after backing out of a free-agent commitment with the Sixers in July in order to sign with Sacramento. The reserve post player was booed during the game.