DALLAS (AP)Tyler Seguin scored with 29 seconds left in overtime and the Dallas Stars beat the Ottawa Senators 4-3 on Thursday night to avoid their first three-game losing streak of the season.

Seguin took a pass from 19-year-old rookie Wyatt Johnston on a nifty play, then went to his knees and pumped both fists in the air after his fifth goal this season – and first in 10 games. Just before that, Seguin had fallen down after whiffing on a puck near the corner.

”We had some good things happen tonight, despite how the game kind of went through 40 minutes,” Stars coach Pete DeBoer said. ”You know, I thought our third (period) was our best. We won an overtime game. Tyler Seguin got a goal, first one in a while.”

The Stars had been 0-5 this season in games that went to overtime.

”We’ve had some good chances in overtime, but we hadn’t capitalized,” said Miro Heiskanen, who scored two early goals for the Stars. ”It’s huge for us to take an overtime win.”

Nils Lundqvist tied it at 3 with 5:06 left in regulation on a shot through traffic from outside the circle to the left of Ottawa goaltender Anton Forsberg. That came immediately after Roope Hintz won a faceoff.

”I thought we played a really good game and to lose that way in overtime, it hurts,” Senators coach D.J. Smith said. ”But in saying that, that’s a really good team and we had all kinds of opportunities to win. Unfortunate bounce off that faceoff, or we’re not sitting here.”

Heiskanen scored twice in less than two minutes to give Dallas a 2-0 lead in the first period. Lundqvist assisted on the second of those goals. The Stars were coming off their first shutout loss of the season two nights earlier despite a season-high 44 shots.

Forsberg and Stars goalie Jake Oettinger both made 28 saves. Forsberg faced one more shot, the game-ender.

Derick Brassard, Thomas Chabot and Travis Hamonic scored for the Senators.

Hamonic gave Ottawa its only lead at 3-2 when he got his stick on the puck in front after Alex DeBrincat’s shot 87 seconds into the third period. That was soon after Dallas had killed off a penalty that carried over from the second.

It was the first two-goal game this season for Heiskanen, but the standout defenseman was also on the ice for both Ottawa goals later in the first period. His turnover in the Stars zone led directly to the first one.

Brassard scored from the slot on a pass from Drake Batherson after he got the puck from Heiskanen. The Senators got even at 2 on Chabot’s hard shot that deflected off a Dallas player and went in just under the crossbar with 1:13 left in the first.

”We really left it all out there. We could have folded there after the first two goals, but we persevered. We faced adversity, but we got better because of it,” Senators forward Brady Tkachuk said. ”And I think that’s just all the lessons that we learned from this year – that whenever we play our game, that some teams have a tough time playing with us.”

NOTES: There were five goals scored by defensemen. The only other time that happened in the NHL this season was Oct. 15, in a game between Anaheim and the New York Islanders. … Seguin’s 10th career OT goal is one behind Jamie Benn for the most in franchise history. … It was the 47th game-winning goal for Seguin, which is third in Stars history behind Mike Modano’s 92 and Benn’s 52. … Hintz and Johnston each had two assists. … Heiskanen has nine points (three goals, six assists) in his last five games.

UP NEXT

Ottawa stays on the road to play Nashville on Saturday.

Dallas wraps up a five-game homestand Saturday against Detroit.

More AP NHL: https://apnews.com/hub/NHL and https://twitter.com/AP-Sports