The forward was selected eighth overall by Toronto at the NHL draft in June.
"Not only does William Nylander bring a high level of speed and skill to his game but he has a very strong character on and off the ice," Maple Leafs general manager Dave Nonis said in a statement. "We believe he has a very bright future and are happy to have him signed to his first NHL contract."
The 18-year-old Nylander had one goal, six assists, seven points and six penalty minutes in 22 games with MODO of the Swedish Hockey League in 2013-14. He also played 18 games for Rogle and 17 games for Sodertalje in Sweden's second division, posting eight points (four goals, four assists) and 19 points (11 goals, eight assists) for each club, respectively.
Nylander, a five-foot-11, 170-pound forward, was selected as the best forward at the 2014 Under-18 World Championship in Finland after leading all players in assists (10) and points (16) in seven games. Sweden finished fourth in the tournament.
Nylander, who was born in Calgary, is the son of Michael Nylander, who played for seven teams during a 920-game, 15-season NHL career.