SAN JOSE, Calif. — Defenceman Dan Boyle retired from the NHL on Wednesday at SAP Center, where he played six seasons with the San Jose Sharks during a 17-year career.

Boyle won the Stanley Cup in 2004 with the Tampa Bay Lightning, one of his four NHL teams, won an Olympic gold medal with Team Canada in 2010 and was a two-time NHL All-Star.

Boyle, who played his final two seasons with the New York Rangers, retired as San Jose's career leader among defencemen in points (269) and assists (201). He ranks second in goals (68) and shots (1,095).

Boyle went undrafted, but he wound up playing 1,093 regular-season games and 130 playoff games during his career with the Florida Panthers, Lightning, Rangers and Sharks. Among defencemen, he ranks 31st in goals, 35th in points and 38th in assists.

"Coming out of college, I was undersized and overlooked and all that stuff that's kind of made me what I am today," said the 5-foot-9, 180-pound Boyle, sitting next to Sharks general manager Doug Wilson, with his family and many of his former San Jose teammates looking on.

"I definitely had a chip on my shoulder. I probably always will. It's just what makes me me, and that's probably what has allowed me to have the career that I had."

Boyle signed with the Panthers as a free agent on March 30, 1998, then was traded to the Lightning in January 2002 for a fifth-round pick.

Boyle said his career took off after a one-on-one meeting he had with current Columbus Blue Jackets coach John Tortorella, who coached him with Tampa Bay.

"We sat down and I asked him, I said, 'Can you please trust me?'" Boyle said. "'I know I play the game a little differently than most, I know it might be a little risky at times, but I know what I'm doing. Just please trust me.'" That's kind of when my true career took off. He trusted in me. I responded with what I thought was good hockey and responsible hockey."

Tortorella talked to Boyle on a speaker phone during his retirement ceremony.

"I don't think you ever received enough credit for what a fierce competitor you were," Tortorella said. "I witnessed it first-hand. You were the engine of our Stanley Cup team. We don't get where we go if it isn't (for) what you do at that rover position that you had, as far as just doing your thing."

Boyle, who will retire in the San Jose area, spent parts of six seasons with the Lightning, playing 394 games and amassing 66 goals, 187 assists and 253 points.

Then on July 4, 2008, Tampa Bay traded Boyle, along with Brad Lukowich, to the Sharks for Matt Carle, Ty Wishart, a first-round draft pick in 2009 and a fourth-round choice in 2010.

"He was like a one-man breakout," Sharks centre Logan Couture said of Boyle. "He could skate the puck out of trouble better than most guys that play this game. As a teammate he was as competitive as they come."

After the 2013-14 season, San Jose traded Boyle's rights to the New York Rangers for a fifth round choice in the 2015 draft. The Rangers signed him to a new contract on July 1, 2014.