ST. PETERSBURG — The Tampa Bay Rays retired Evan Longoria’s No. 3 jersey during a pregame ceremony at Tropicana Field on Sunday afternoon, permanently honoring the franchise icon who defined the club from 2008 to 2017 and making it only the fourth number the organization has ever taken out of circulation.

The No. 3 almost never happened. When Longoria was called up in 2008, he wanted No. 6 — the number he wore at Long Beach State and throughout the Minor Leagues. But that number belonged to Tom Foley, Tampa Bay’s third-base coach, who asked for a set of golf clubs in exchange. Longoria balked. “I was just being cheap, and I guess I didn’t really care too much about the number,” Longoria recalled. “So I was like, ‘Well, what other single-digit numbers are available?’” Chris Westmoreland, then the Rays’ home clubhouse and equipment manager and now the senior director of team travel and logistics, offered him No. 3.

“I just took No. 3 — and it’s going up in the rafters,” Longoria said. “So, it’s special now.”

With the rock band Tantric performing a live rendition of his iconic walk-up song, “Down and Out,” Longoria and his family — all wearing his No. 3 jersey — watched as the number was unveiled in the left-field corner next to Don Zimmer’s No. 66. Longtime teammate James Shields and Foley himself helped with the unveiling. The ceremony followed Longoria’s induction into the Rays Hall of Fame on Saturday, adding to a statue already installed outside Tropicana Field commemorating his famous “Game 162” home run.

“The details were all super special,” Longoria said. “I’m glad we had some old, familiar faces up there to do it and just made it even that much more special.”

Longoria entered the field from an entrance adjacent to 162 Landing, where his historic walk-off shot cleared the fence, as the sharp electric violin riff of “Down and Out” sent the crowd into a frenzy. “I get chills every time I hear the Tantric song,” Rays manager Kevin Cash said. The song found Longoria by accident — as a rookie in 2008, he was given a pre-loaded iPod, and the track happened to be on it. He thought the introduction sounded “cool” and kept it. After winning AL Rookie of the Year during the Rays’ run to the World Series, he figured it was too good to change. When he later asked fans on social media whether he should pick a new walk-up song, the response was universal: Don’t.

“So I was like, ‘OK, well, I’m never going to ask that question again,’” Longoria said. “It just stayed with me.”

No player has worn No. 3 for the Rays since Longoria was traded to the Giants in late 2017. The Rays now have four retired numbers: No. 12, worn by Hall of Famer Wade Boggs during his two seasons with Tampa Bay; No. 66 for the late Zimmer, one of Longoria’s earliest friends and most impactful mentors; Jackie Robinson’s No. 42, retired throughout Major League Baseball; and now No. 3.

“Longo, to me, was one of my favorite teammates of all time,” Shields said. “He was a true professional every single day. He worked hard every single day. Obviously his career spoke for itself. But more importantly, he was just a good ambassador for the game.”

Longoria, whose 16-year career spanned a decade as the face of the franchise, joked about the future. “Well, 50 years from now, when the Rays have all these great players and all the numbers are gone, we’ll be complaining about the same thing — that all the good numbers are gone,” he said. “I think it has meant so much to my family, being able to put that jersey on. From the beginning of my first opportunity here up until this moment, 20 years of just life, basically, culminating in such a special moment is really cool.”

The Rays fell to the Mariners 8-2 in the game that followed the ceremony.