BUFFALO — Sam Bennett and Mark Jankowski scored three minutes apart in the first period and the Calgary Flames ended a four-game skid with a 5-1 win against the Buffalo Sabres on Wednesday night.

Calgary improved to 1-3-1 in its last five games to gain ground in the tightly contested Western Conference playoff race. With 76 points, the Flames jumped into 10th place, a point ahead of the idle St. Louis Blues, and within one of the Los Angeles Kings and Colorado Avalanche.

Mark Giordano also had a goal and assist, while Sean Monahan and Dougie Hamilton also scored.

The Flames won at Buffalo for the second time in 14 trips (2-8-3 and a tie), and first time in regulation since a 3-1 win on March 15, 1996.

Rookie David Rittich stopped 25 shots before having his first career shutout bid spoiled when Casey Nelson scored with 18 seconds remaining.

The Sabres came out flat in a first period in which they were outshot 17-6 and outscored 2-0. The margin could have been even larger had goalie Chris Johnson not stopped Michael Ferland and Michael Frolik driving alone to the net on chances two minutes apart.

Johnson, who spent last season with the Flames, stopped 18 shots before being pulled after Monahan scored to put Calgary up 4-0 at the 6:01 mark of the second period. Robin Lehner allowed one goal on 19 shots.

Rittich was hardly tested, though his best save came three minutes into second period, when he got his left shoulder up to stop Jason Pominville's one-timer from the left circle during a Sabres power play.

Buffalo squandered a chance to win three in a row at home for the first time since a 4-0 run in January 2017.

Bennett opened the scoring 5:35 in after a Sabres breakdown in front of their own net. Bennett drove to the net to collect a loose puck and snapped it over Johnson, who was flat on his back.

NEWSLETTERS

Get the Sports newsletter delivered to your inbox

We're sorry, but something went wrong

Sports news, no matter the season. Stop by for the scores, stay for the stories.

Bennett then set up Jankowski's goal by driving up the left wing and entering the Sabres zone. He fed a pass into the middle, where Jankowski used Buffalo's Casey Nelson as a screen and snapped a 40-footer that sneaked in under Johnson's left arm.

Nothing went any better for Buffalo in the second period when Giordano and Monahan scored 61 seconds apart to put Calgary up 4-0 with 13:59 left. Giordano scored on a shot from the blue line that deflected in off Pominville. Monahan scored after being left alone for a one-timer in the right circle.

Hamilton capped Calgary's three-goal second-period surge by beating Lehner inside the right post for a power-play goal with 1:21 left.

The Flames were on the man-advantage because of a roughing penalty against Lehner for using his glove hand to punch Calgary forward Matt Tkachuk in the face. Lehner scooped a bouncing puck and the play had been whistled dead when Tkachuk came to a skidding stop and sprayed the goalie with snow. Lehner got up and struck Tkachuk, who was then bowled over by a check from Buffalo's Jordan Nolan.

NOTES: The Sabres called up C Danny O'Regan from AHL Rochester to fill in after Kyle Criscuolo sustained upper-body injury in a 5-3 win against Toronto on Monday. O'Regan was acquired in the trade that sent Evander Kane to San Jose last week. ... Flames LW Johnny Gaudreau had two assists in playing his 300th career game. ... Gaudreau's 56 assists this season are the most by a Flames player since Alex Tanguay had 59 in 2006-07. ... The Flames once went 0-11 and a tie in 12 straight trips to Buffalo from March 11, 1979, when they were still in Atlanta, to Nov. 10, 1985.

March 29: Columbus Blue Jackets forward Pierre-Luc Dubois (18) celebrates his hat trick goal with teammates during the third period of a 5-1 win over the Calgary Flames. Sergei Belski, USA TODAY Sports

Nov. 27: Blackhawks right wing Alex DeBrincat is congratulated by his teammates for notching a hat trick during the second period against the Ducks at the United Center in Chicago. Dennis Wierzbicki, USA TODAY Sports

Washington Capitals left wing Alex Ovechkin (8) celebrates his hat trick goal with center Nicklas Backstrom (19) late in the third period against the Toronto Maple Leafs at Air Canada Centre. The hat trick was the 20th of Ovechkin's career. Tom Szczerbowski, USA TODAY Sports

Colorado Avalanche forward Gabriel Landeskog (92) is sprayed by goalie Jonathan Bernier (45) following his hat trick goal in the third period of a 6-2 win against the Washington Capitals on Nov. 16. Ron Chenoy, USA TODAY Sports