This wasn’t how it was supposed to go if you saw the Kings’ last two games.

The Houston Rockets are the NBA’s top-scoring team, and the Kings’ defense has been miserable much of the season, especially in their previous two games, giving up an average of 119 points.

But the Kings held the Rockets 16 points below their average and to 41.3 percent shooting in defeating Houston 106-91 on Sunday at Sleep Train Arena.

It was the kind of defensive effort Kings coach Michael Malone has been searching for.

“I feel a lot better than I did after the last two games,” Malone said. “It must have been a great film session (Saturday), I guess.”

The Kings had plenty to review over their previous two losses. There were breakdowns all over the floor with opposing guards getting to their preferred spots with little resistance and big men finishing uncontested shots.

The Kings’ focus was much better Sunday. Malone said the Kings were embarrassed by their play of late.

Some of that also had to do with playing the Rockets, who have two All-Stars in Dwight Howard and James Harden.

“We had our antennas up,” Malone said. “That’s a very good team over there. So when James Harden, Dwight Howard and company come in, guys are ready to play.”

The Rockets scored 28 points in the first quarter and shot 55 percent. But instead of conceding it would be another game when the Kings would allow a team to score close to 120 points, Sacramento held the Rockets to 36.4 percent shooting the rest of the game.

“We just played hard,” Kings guard Isaiah Thomas said. “We played hard on defense; we were dialed. Attention to detail was good for us in practice (Saturday) and scout (work) before the game.”