Liles, 30, had one year remaining on his deal, which carries a $4.2 million cap hit.
The pick the Avalanche are getting originally belonged to the Boston Bruins, and the Leafs previously acquired it in a trade.
Liles had six goals and a career-high 40 assists in 76 games with Colorado last season.
Liles, who has played his entire seven-year NHL career with the Avalanche, has led the club in scoring by a defenseman five consecutive seasons. In 36 playoff games during that span, he has four goals and seven assists.
Dave Nonis, the Maple Leafs' senior vice president of hockey operations, said in Minnesota before the draft that he was close to making a trade for Liles at the deadline in February.
"It just didn't come together," Nonis said. "It wasn't anyone's fault. We just couldn't find a match. But we were able to, in the last 24 hours, find a match that made sense for both teams."
Information from ESPN.com's Pierre LeBrun and The Associated Press was used in this report.