RALEIGH, N.C. (AP) _ David Pastrnak scored three of Boston's five goals in the final 10 minutes for his first career hat trick, and the Bruins stunned the Carolina Hurricanes by rallying for a 6-4 victory Tuesday night.

Matt Grzelcyk, Pastrnak and Danton Heinen scored in a span of 77 seconds to turn a 4-1 Bruins deficit into a 4-all tie.

Grzelcyk fired home a slap shot with 9:56 remaining, Pastrnak scored on a wrister 56 seconds later and Heinen followed 21 seconds after that with the tying goal, banging home a one-timer off a 2-on-1 rush with David Krejci. 

Pastrnak put Boston ahead on a power-play goal with 3:30 left and finished off his hat trick with an empty-net goal with 1:34 remaining. 

Brad Marchand had a goal and two assists for the Bruins, who snapped a three-game road losing streak. Tuukka Rask made 29 saves.

Sebastian Aho, Teuvo Teravainen and Justin Williams scored in the second period for Carolina. Brock McGinn added a short-handed goal 51 seconds into the third to make it 4-1, but the Hurricanes couldn't hold it. 

Justin Faulk and Elias Lindholm each had two assists, and Cam Ward stopped 28 shots. It was a deflating loss for the Hurricanes, who missed a chance to make up ground as they chase the final playoff spot in the Eastern Conference. They are seven points back with 12 games remaining.

NOTES: Aho set a career high with his 25th goal. ... Teravainen has eight goals and three assists in his last 11 games. ... Bruins forward David Backes returned after serving a three-game suspension for a late hit to the head against Detroit's Frans Nielsen last Tuesday. ... Bruins coach Bruce Cassidy said forward Patrice Bergeron (broken foot) did not make the trip and will be out until at least next week. D Charlie McAvoy (MCL sprain) missed the game as well.

UP NEXT

Bruins: At the Florida Panthers on Thursday night.

Hurricanes: Host the Philadelphia Flyers on Saturday.