The Los Angeles Kings have agreed to terms with Todd McLellan on a multiyear contract to be the team's new coach, it was announced Tuesday.

He replaces Willie Desjardins, who served as the interim coach last season and was not retained after the two-time Stanley Cup-winning franchise slumped to the NHL's second-worst record this season.

McLellan, 51, will receive a five-year contract worth around $5 million annually, the Athletic reported. He also was a candidate for the coaching vacancy in Buffalo.

McLellan, who led the Edmonton Oilers to their first 100-point season since 1987 and their only playoff appearance since 2006, was fired in November after a 9-10-1 start. He had been behind the bench in Edmonton since the 2015-16 season after spending seven seasons as the San Jose Sharks' coach.

He has a career record of 434-282-90 in 806 regular-season games, which ranks 33rd in NHL history and 11th among active coaches. He also has reached the playoffs in seven of his 10 full seasons as an NHL head coach.

Desjardins, 62, was named the Kings' interim coach in November after John Stevens was fired following the team's 4-8-1 start. The Kings went 27-34-8 the rest of the season with Desjardins as coach and finished last in the Western Conference.

McLellan is taking on a rebuilding job with the Kings, who haven't won a playoff series since claiming their second Stanley Cup title five years ago.

Los Angeles was the NHL's second lowest-scoring team last season, managing just 199 goals despite the elite talents of Anze Kopitar, Drew Doughty and Jeff Carter. The Kings' 259 goals allowed were the 10th-most in the league despite the presence of Conn Smythe Trophy-winning goalie Jonathan Quick.

The Kings also had a dismal draft lottery last week, slipping the maximum three places to the fifth overall pick.