Former President Obama congratulated Dwyane Wade on Tuesday as the NBA star prepares to retire, joking that he too had to walk away from a professional career in basketball because of his knees.

“D-Wade! Congratulations on a great run. Now, I know what you’re going through because saying goodbye to a career that you love is never easy. I’ve been there. In my case, though, I didn’t really have a choice,” the former two-term president joked in a video posted on Twitter.

“My knees were shot, so I had to give up basketball forever. You, on the other hand, look like you’re still hooping out there,” Obama continued. “And I imagine it’s a little tougher when you’ve just completed one of the greatest careers in NBA history.”

Obama’s tribute video, posted by the Miami Heat, came ahead of Wade’s final home game with the team this week before he retires at the end of season.

Obama, an avid basketball fan, thanked Wade for 16 years of “high-wire dunks, big shots and big moments.”

The former Illinois senator also mentioned Wade’s hometown of Chicago.

“You were willing to sacrifice your body in the lane and sometimes sacrifice your ego in pursuit of a title. And whenever you got knocked down, you always showed us how to get back up,” Obama said. “So you showed some Chicago spirit in you, and you did us proud.”

Obama ended the video by praising the future Hall of Famer for his “extraordinary career.”

“I hope the next phase of your life is just as fulfilling and just as spectacular as this one has been. Take care,” he concluded. 

The 57-year-old former president played pick-up games with a variety of basketball pros during his time in the White House, including Wade, LeBron James, Magic Johnson and Alonzo Mourning.