The Chicago Blackhawks were right there for just about all of their game against the St. Louis Blues on Thursday night. But a gaffe here and there proved costly against a Blues team that was more than happy to capitalize on them.

Viktor Stalberg scored with less than five minutes remaining in regulation, but Kevin Shattenkirk had the winner in the shootout as the Blues beat the Blackhawks 4-3 at the United Center. The Blackhawks remain atop the Western Conference, three points ahead of idle Anaheim.

Jonathan Toews had a goal and an assist of the Blackhawks, who had a 2-1 lead entering the third period. But the Blues fought back, adding a rare blemish to the Blackhawks’ strong record when leading after two periods (now 20-1-2). But while the Blackhawks had the lead, the Blues had a little more of the drive.

“It’s frustrating. A couple of mistakes, we give up a lead,” Bryan Bickell said. “We were happy to get the game-tying goal, but it was a tough one.”

Coach Joel Quenneville liked the way the Blackhawks played on Thursday, for the most part.

“Playing from behind, [the Blues] were probably taking more risks than in the first part of the game. If we take advantage and press more, hopefully we can get the odd-man breaks and catch them from trying to score. If we check better, we probably get more advantages offensively. Don’t think we gave up a ton. We only gave up three chances, and that was the difference.

“We won these games earlier on in the year, but they’re all comparable scores,” Quenneville continued. “We could’ve won in the shootout. We didn’t hurt ourselves as far as giving ourselves a chance. We had some god chances late in the game.”