Back in 2006, a 9-year-old Katie Ledecky beamed after she got an autograph from Michael Phelps.

Ten years later, Phelps, the most decorated Olympian of all time, wasn't going to leave Rio de Janeiro without an autograph from Ledecky.

9-year-old Katie Ledecky gets an autograph from Michael Phelps in 2006... and co-signs her own in 2016! @darrenrovell / Brandon Goodwin / TODAY

The 19-year-old phenom and the 31-year-old retiring legend re-created their now-famous photo for TODAY on Monday, except this time Phelps was the one with a big smile as Ledecky added her signature.

Trending stories,celebrity news and all the best of TODAY. This site is protected by recaptcha

RELATED: Here's the moment a 9-year-old Katie Ledecky got Michael Phelps' autograph

There was plenty to smile about as Ledecky walked away from Rio with five total medals, four of them gold, along with two world records. Phelps finished his amazing career with an Olympic-record 23 gold medals and 28 overall, including five gold medals in Rio.

"We are in great shape, not only with Katie but with the team that we have now,'' Phelps said on TODAY Monday. "Katie's doing her thing and she's breaking records every time she gets in the pool. It's been an honor for me to be a part of the team with her and some of the younger guys that we have coming up in the sport that are going to take over."

Phelps has been an inspiration to Ledecky since the beginning of her love for swimming.

"A lot of the young swimmers on the team we all looked up to him when we were 6 years old,'' she said on TODAY Monday.

Michael Phelps and Katie Ledecky basked in the glow of an amazing performance in Rio along with Phelps' fiancee, Nicole Johnson, and their little boy, Boomer. Brandon Goodwin / TODAY

She quickly realized how old that made Phelps seem.

"I didn't mean it like that!" she joked. "I started watching him when I was 6 years old when I was first starting to get in the sport and to be on the team with him has been such an honor."

Follow TODAY.com writer Scott Stump on Twitter.