Shaun Livingston revived his career after one of the worst injuries in NBA history and went on to win three championships with the Warriors. (Ben Margot/AP, File)

After 15 years that spanned the great distance between a career-threatening knee injury and an ascent to basketball’s zenith, Shaun Livingston has decided to hang up his sneakers.

“I wasn’t supposed to be here,” Livingston wrote in an Instagram post Friday announcing his retirement. “Anybody that has beat the odds understands the mental and emotional strain it takes to inspire yourself on an uphill war, let alone inspire others.”

When Livingston entered the NBA as a high school star taken fourth overall in the 2004 draft, he had to have known there was no way to guess how his career would turn out. But he never could have predicted what would happen three years later.

As a member of the Los Angeles Clippers, Livingston was playing in a regular season game against the Charlotte Bobcats when attempted to make a standard layup. When he came down, his left knee bent in a way no knee was ever meant to.

The result was one of the most gruesome injuries seen in sports. The 21-year-old tore his ACL, PCL, MCL, lateral meniscus and dislocated both his knee cap and tibiofemoral joint.

Livingston told The Undefeated in 2016 that his leg “was like a pole with a pineapple in the middle of it.” Doctors worried that the leg would require amputation. His career was in serious doubt.

Livingston had to learn to walk again through a grueling rehabilitation. He missed the entire 2007-2008 season. After 16 months, he resumed basketball activities. After 20 months, he was back on the court again as a member of the Miami Heat. Overall, Livingston played in just 22 games from when he suffered the injury through the end of the 2009-2010 season.

Yet although Livingston only posted two points and one assist in four minutes on that Heat squad, what didn’t show up on the stat sheet was the confidence he gained knowing he could, in fact, play NBA minutes again.

“‘The injury’ gave me a chance to find and prove to myself (and the world) that I wouldn’t be defined by my circumstances,” Livingston wrote the Instagram post. “With my time in the League what I will be most proud of is the fact that my character, values and faith were tested, and I persevered.”

He spent just four games with Miami before bouncing around the league. He was traded to the Memphis Grizzlies before spending time with the Oklahoma City Thunder, Washington Wizards (for two stints), Charlotte Bobcats, Milwaukee Bucks, Houston Rockets (no games played), Cleveland Cavaliers and Brooklyn Nets, with whom he showed enough over 76 games in the 2013-2014 season to catch the eye of the Golden State Warriors.

Livingston joined the Warriors for the start of the following year, just in time for the beginning of their dynasty. In Oakland, he became an unsung cog on a team that has appeared in the last five NBA Finals, and won three championships. He developed into one of the NBA’s most respected players and a revered teammate.

Following his announcement, the praise for Livingston began rolling in.

“Shaun Livingston’s story is one of the most inspirational in the history of professional sports,” Warriors president of basketball operations and general manager Bob Myers said in a statement Friday. “What he accomplished after suffering so many trials and tribulations early in his career is a true testament to who he is as a person, which has always been characterized by tremendous class, grace and professionalism. He represents everything that you’d want in a professional athlete and, most importantly, in a human being. We appreciate what he did for our team and organization over the last five years, becoming a three-time NBA champion and a key figure on one of the best teams in NBA history. We wish him well as he begins the next phase in his life.”

Livingston, who turned 34 on Wednesday, scored 5,231 points in 17,188 minutes over the course of 833 career games. In a salary cap move, the Warriors waived him in July. He has reportedly discussed working in the team’s front office.

Read more NBA:

Sign up for our weekly NBA newsletter to get the best basketball coverage in your inbox

Australia’s response to its World Cup loss to Spain was fantastically NSFW

For USA Basketball, dominance can no longer be assumed

An ode to the NBA’s ‘ninja-style’ headbands: Gone but not forgotten