No financial terms were disclosed but it was expected to be for the maximum $11.325 million allowed under rules on extra-level NHL deals.
Dahlin, who turned 18 in April, scored eight goals and set-up 15 others in 67 games for Swedish league side Frolunda over the past two seasons, the most ever by an under-18 Swedish league defenceman.
“It has been a dream since I was a little kid,” Dahlin said of playing in the NHL. “It has been a long wait and you can't really plan anything, but finally I can plan my future and I love to call my new town Buffalo.”
Dahlin, the first Swedish player selected first overall in the NHL Draft since Quebec picked Mats Sundin in 1989, helped Sweden to a silver medal at this year's World Junior Championship in Buffalo.
At 17, Dahlin was the youngest player at the 2018 PyeongChang Winter Olympics.