CALGARY, Alberta — Matthew Tkachuk scored his 40th goal, Christopher Tanev scored the tiebreaking goal in the third period, and the Calgary Flames beat the Dallas Stars 4-2 on Thursday night to win the Pacific Division title.

The Flames won their division for the eighth time in franchise history but just the third in the last 27 years.

“The team deserves it,” coach Darryl Sutter said. “They’ve been the most consistent team in the division. They deserve to win the division.”

Noah Hanifin and Andrew Mangiapane also scored for Calgary, which is 8-1-1 in its past 10 games.

“It’s an accomplishment to win the division,” Mikael Backlund said. “It’s a long season. So the guys have done a great job and I’m really proud of our team.

“We’re not satisfied. We want to do something really big here. We know we can do it.”

Jason Robertson and Luke Glendening scored for the Stars, who lost all three games on their Western Canada trip as they fight for a wild-card playoff berth.

The Flames will host the top Western Conference wild card in the first playoff round. Dallas has a precarious hold on the second wild-card spot, two points ahead of Vegas. The Stars play their last four games at home.

“If we’ve got to do it the hard way, well, we’re going to do it the hard way,” Stars coach Rick Bowness said. “We get back to a great atmosphere in our rink, and we’ve got four home games.

“We still control our own destiny. We just have to take full advantage of it – and we’re going to.”

Jacob Markstrom had 21 saves for the Flames, and Jake Oettinger stopped 33 shots for Dallas.

“We would like to have locked up our spot already. This road trip, we kind of gave some other teams some life,” Oettinger said.

Calgary went ahead 2-1 20 seconds into the third period when Hanifin’s point shot eluded Oettinger, who was screened by Backlund.

The Stars answered five minutes later. Fredrik Karlstrom was stopped on a partial breakaway, but in making the save, Markstrom’s momentum carried him to out of the crease. Glendening was right there to deposit the rebound into the vacant net.

The assist by Karlstrom was his first NHL point in his first career game.

Tanev made it 3-2 at 13:05 on a point shot that deflected in off the leg of Glendening, who was battling with Backlund in front. Mangiapane’s goal was an empty-netter.

Calgary scored first for the NHL-leading 50th time. With the Flames on the power play, Tkachuk stuffed the puck in from the side of the net at 10:06 of the second and thrust his arms in the air in celebration as his linemates mobbed him.

“You can tell right away when he entered the league, he was a special player,” Backlund said. “Special, character on the ice, loves scoring goals and a big-time player.

“He’s just been getting better and better every year and this year he’s taken it to another level.”

Tkachuk’s goal also put the 24-year-old winger at 100 points. His previous career highs were 34 goals and 77 points in 2018-19. Johnny Gaudreau reached 100 points last week, giving Calgary two players over the century mark for the first time since 1990-91 when Theo Fleury and Al MacInnis did it.

“I was probably more excited about the 40 to be completely honest,” Tkachuk said. “Coolest part for me was the guys coming in, they were way more excited than I was and I didn’t think that could be possible.”

Robertson tied the game on the power play less than two minutes after Tkachuk’s goal.

The Associated Press contributed to this story.