Rudy Gay is retiring after 17 NBA seasons, the veteran announced Tuesday.

Gay, 38, last played in the 2022-23 season for the Utah Jazz. He had signed a contract with the Golden State Warriors last summer but was waived shortly before the season.

“I needed to humble myself and be like: ‘Look, this is over,’ Gay wrote in a piece for The Players’ Tribune on Tuesday. “But actually coming to grips with it being over, that’s … a process. One I’m honestly still dealing with, and struggle with at times. I’ll still be watching games and see some of these guys missing a pass or fumbling the ball out of bounds, and I absolutely am that dude yelling at the TV like: ‘I’m better than that clown. Are you kidding me?!?!?’ It’s not pretty.

“I’m 38 years old. That’s nowhere even near mid-career for most people’s professional lives. So, the way I see it, I’ve got a lot of work ahead of me. … In the meantime, I’m just feeling extremely grateful for all the love, wisdom, and friendship that I’ve experienced in the game of basketball.”

After starring at UConn, Gay was selected with the No. 8 pick in the 2006 NBA draft by the Houston Rockets and traded a few weeks later to the Memphis Grizzlies, where he made the All-Rookie team that season. He ranks fifth in points, fourth in minutes played and fourth in games played in Grizzlies history.

Gay is one of four players to average 10 or more points from the 2006-07 season to the 2020-21 season, along with Carmelo Anthony, Chris Paul and LeBron James.

Gay spent much of his career with Grizzlies and Sacramento Kings and averaged 15.8 points and 5.6 rebounds across 1,120 career games (778 starts). He also spent time with the Toronto Raptors, San Antonio Spurs and, most recently, the Jazz.

“I’m the luckiest man in the world,” Gay wrote.