William Nylander, Zach Hyman and Rasmus Sandin each scored and had an assist to lead the Toronto Maple Leafs over the Nashville Predators 5-2 Monday night.

Jason Spezza and Auston Matthews also scored and Frederik Andersen made 34 saves for the Maple Leafs, who snapped a two-game losing streak.

"I liked that through different periods of the game, I thought we did a really nice job of doing the things that we wanted to do," Toronto coach Sheldon Keefe said. "In a game like this, you're not really sure what you are going to get coming off that type of a break."

Mikael Granlund and Viktor Arvidsson scored for Nashville, which has lost of three of four.

WATCH | Balanced attack helps Leafs defeat Predators:

19-year-old Rasmus Sandin scored the first goal of his career in Toronto's 5-2 victory in Nashville. 1:45

Both teams played their first game in more than a week after their bye week and the league's All-Star break.

"We've got to do a better job of understanding that you're not always going to have the lead," Nashville coach John Hynes said. "You've got to have pushback in games, a little bit more mental fortitude and consistency in what we're doing and consistency throughout our lineup."

Nylander scored first at 4:13 of the opening period, giving him a goal in four straight games. From deep inside the Toronto zone, Sandin lofted a long pass to Nylander down the middle of the ice. Nylander corralled the puck just outside the blue line, skated in alone against goalie Pekka Rinne and beat him with a low wrist shot.

THAT’S RIDICULOUS FREDDIE <a href="https://twitter.com/hashtag/LeafsForever?src=hash&ref_src=twsrc%5Etfw">#LeafsForever</a> <a href="https://t.co/CZOoGDXy8n">pic.twitter.com/CZOoGDXy8n</a> —@MapleLeafs

Rinne finished with 26 saves.

Granlund tied it 40 seconds later. Granlund began a breakout from the Nashville zone and sent a pass to Matt Duchene on the left side. Duchene sent a pass back to Granlund in the low slot, where he snapped one past Andersen on the short side.

Hyman made it 2-1 at 7:12 of the first when he tapped in a rebound of Mitch Marner's shot from the right side.

Sandin's first career goal gave the Maple Leafs a 3-1 lead at 4:41 of the second.

"I'm going to remember that for the rest of my life for sure," the 19-year-old Sandin said. "It was a great feeling."

A moment of silence is observed during a tribute to the late Kobe Bryant before the game. (Mark Humphrey/The Associated Press)

Spezza followed at 12:17 of the second with his seventh goal of the season, just six seconds after a Toronto power play expired.

"Coming out of a break can be difficult games," Spezza said. "I thought it was a good match for our team just coming out and getting the lead. I thought we controlled play for a lot of the time."

Arvidsson scored on a rebound of Mattias Ekholm's shot at 12:52 of the third to halve Toronto's lead.

"The last 10 minutes, I thought we had a good push, I mean we scored a goal," Predators captain Roman Josi said. "We had some chances after that, but it's got to be 60 minutes. It's a really good team over there. You're not going to win a game playing the first period and the last 10 minutes."

Matthews scored an empty-net goal late.