San Jose made Hannan the 23rd pick in the 1997 NHL Draft. He spent his first eight seasons with the Sharks and returned to play 118 games for them over the past three seasons finishing in 2014-15. Hannan's 626 total games with the Sharks rank sixth in their history, third among defensemen.
"He was a player's player, well respected by his teammates and he truly loves the game," Sharks general manager Doug Wilson said. "We want to thank Scott and his wife, Kristina, for all they have done for the Sharks franchise and wish them the very best."
Hannan also played in the League with the Colorado Avalanche, Washington Capitals, Calgary Flames and Nashville Predators, scoring 38 goals and 217 points in 1,055 regular-season games.
Hannan had one goal and 21 points in 100 Stanley Cup Playoff games, reaching the Western Conference Final with the Sharks in 2004.
He made his NHL debut late in the 1998-99 season after finishing a four-year junior career with Kelowna of the Western Hockey League.
"I'd be remiss for not also thanking Bruce Hamilton and Lorne Frey with the Kelowna Rockets for putting me on the path to have a chance to play in the NHL," Hannan said. "Most importantly, I want to thank all of my family, particularly my wife Kristina and my boys, Gage and Owen. Their sacrifices have allowed me the opportunity to follow this dream of playing in the National Hockey League."