It was the fourth St. Louis loss at home in regulation time this season. Only Detroit has fewer home setbacks.
Boston took a 2-0 lead early in the contest but St. Louis came back to tie it before the opening period was over.
With Kelly's goal giving the Bruins a 3-2 lead heading into the final period, Boston turned to Tim Thomas to protect the advantage.
Thomas made 30 saves to get the win.
Brian Elliott let in four goals on just 19 shots.
Brad Marchand produced the opening goal of the game and he clinched the victory by putting a backhander past Elliott with 46 seconds left in regulation.
Boston snapped a two-game skid and maintained its two-point advantage over Ottawa in the Northeast Division.
Megyn Kelly: Santa Claus and Jesus are both white men
Costly malfunction causes beer flood at Boston-area brewery