Justin Williams’ timing was perfect Tuesday. Jonathan Quick’s reflexes were impeccable, too. The Kings’ penalty-killing remained flawless.

Funny what a long winning streak can do for a team. Williams, Quick and the Kings’ special teams play propelled them to a hard-earned 1-0 victory over the Detroit Red Wings at Staples Center, the team’s eighth consecutive victory.

Williams scored the only goal the Kings needed to improve their overall record to 29-18-12 and strengthen their hold on third place in the Pacific Division standings. Quick made 25 saves for his fourth shutout of the season and the 35th of his career.

The Kings’ penalty-killers extended their streak of perfection to 20 consecutive shorthanded situations. They haven’t given up a power-play goal since the second period of a 5-3 victory Feb. 12 over the Calgary Flames, a span of five straight games.

Instead of reeling, as they were three weeks ago, the Kings are brimming with confidence. Their surge of momentum has carried them from the depths of the Western Conference standings to a more comfortable seventh position. Instead of fighting for a wild-card spot, they’re battling for home-ice advantage.

“You win one, you win two, and you feel more confident,” said Kings center Anze Kopitar, who assisted on Williams’ goal only 2 minutes, 24 seconds into the game. “Just because we were in the position we were in before, a streak like this would pull us out of that hole.

“Now we’ve broken even, but now we’ve got to keep going like this.”

Quick’s play in goal has been the key to all the Kings have achieved in regaining a playoff spot after an atrocious midseason slump that featured 10 losses in 12 games during one stretch and threatened to derail any hope they had of defending their Stanley Cup championship.