Katie Ledecky, 19, says she's really happy in swimming, in life and in her decision to stay an amateur and see what opportunities arise in collegiate swimming. (0:53)

RIO DE JANEIRO -- After swimming arguably the greatest race of her young career, Katie Ledecky waited, waited and then waited some more. For more than 11 seconds, she placed her right hand on the wall and bobbed in the water, waiting for the others to arrive.

She knew she had finished her 2016 season reaching the last goal she had set for herself -- a world record in the 800-meter freestyle. It was her 13th world record, and it shattered her 8-month-old mark in the event by nearly two seconds. But for the time being, there was no one to celebrate with. Ledecky was simply too good, too dominant. The rest of the field had been left behind. When she touched the wall, nobody else was even on the screen on television.

It took 11.38 seconds before the next swimmer arrived -- in this case, Great Britain's Jazmin Carlin. The gold was Ledecky's fourth in Rio, completing her sweep of the 200, 400 and 800 freestyle races, capping off one of the greatest performances in Olympic swimming history. She is 19 years old.

Some fifteen minutes earlier, another story had unfolded -- with an altogether different ending. In the final individual race of his decorated career, 31-year-old Michael Phelps touched the wall in an unprecedented three-way tie for second in the 100-meter butterfly. And yet in a way, the outcome made perfect sense -- and dovetailed beautifully with Ledecky's blindingly bright future.

It was 2002 or 2003 -- Ledecky can't remember -- when she first met Phelps at a swim meet in Maryland. He was the next big thing back then, before he erupted into the global icon he has become today. Ledecky got Phelps' autograph that day -- an autograph she says she still has. And here they were on this night, one career coming to an end, another blowing up, in the most positive sense.

You would think then that the tears on Friday night would have come from Phelps. Losing the last individual race of his career. Reflecting on all that he's put into the sport. And yet the exact opposite was true. Following his 100 fly loss, Phelps was noticeably content -- perhaps even cheerful, in a strange way.

Katie Ledecky picked up her fourth gold medal of the Rio Games on Friday night. At age 19, she's already won six Olympic medals, five of them gold. Julio Cortez/AP Photo

He knew the 21-year-old who beat him for gold. They had met eight years earlier in Singapore, during the Americans' pre-Beijing training camp. Phelps, while searching for monkeys, rode in a golf cart with Joseph Schooling, who would go on to train at the Bolles School in Florida and then attend the University of Texas. On Friday night, they would stand next to one another on the medal podium and then sit next to each other in a postrace news conference.

"It's pretty crazy what can happen in eight years," Schooling said. "It's an honor and privilege to even race alongside him."

As Schooling spoke, Phelps smiled and nodded. He knew Schooling's success was in some tiny way credited to the seed he helped plant years earlier. As a 15-year-old, Phelps told agent Peter Carlisle he wanted to change the sport of swimming. And on the eve of the final night of Phelps' career, the results of that decision could seemingly be seen everywhere.

"In the past, I probably would have been really, really upset if I lost a race," Phelps said. "I'm not super happy. Nobody likes to lose. But I'm proud of Joe. He swam the best race. And for me, I've been able to know Joe for a long time and see him turn into the swimmer he is. I'm excited to see what more there is to come."

As Phelps fielded question after question in the postrace news conference, he chided reporters.

"Joe should be getting most of the questions," Phelps said. "He just won a gold medal, guys."

Schooling shook his head, blushing uncomfortably.

Beyond Schooling, there was South Africa's Chad le Clos, who swims butterfly because of Phelps and grew up worshiping the American. He and Hungarian Laszlo Cseh were the pair who tied Phelps for silver in the 100 fly.

There was 200 backstroke gold medalist Maya DiRado, who Phelps yelled to across the mixed zone in order to give her a great big hug and offer congratulations.

And then there was Ledecky, the typically stoic competitor who, uncharacteristically, couldn't get through a brief interview without breaking down in tears, overcome by the emotion of the final chapter in this part of her career. In a couple of weeks, Ledecky will leave her Bethesda, Maryland, home -- and coach Bruce Gemmell -- to head to Stanford University.

Michael Phelps swam the last individual race of his career Friday night and earned a silver medal. Afterward, he dismissed the notion that he might return for the 2020 Games. Erich Schlegel/USA TODAY Sports

"It's kind of the end of a four-year journey," Ledecky said. "I've had a lot of fun, and I don't know why I'm crying. There were nights I would go to bed and think about this day and how much fun I've had these past four years, and I'd start to cry in bed. And I just wanted to make this meet count and have a lot of fun with it."

Ledecky did more than that. She will leave Rio as the third American woman with four gold medals in any sport at a single Games. She is only the second woman to win the 200, 400 and 800 freestyle events in a single Olympics. And she extended her streak to 15 straight individual gold medals in the finals of major international meets.

"What she's doing in the sport is ridiculous," Phelps said. "It's insane. She just gets in the water and gives every world record a scare whenever she's in there. It's pretty incredible to watch. This is the first time I've ever seen her in tears in a race. The first time in my life I've ever seen true emotion really come out. I think that was really cool to see."

They are once-in-a-lifetime talents. But there are two of them. And although Ledecky tried to downplay any talk of a proverbial passing of the torch on Friday night, that's exactly what it was. The most decorated Olympian of all time preparing to hang up his suit for the final time. And the 19-year-old woman just as jaw-droppingly talented showing up to fill that void.

"We have arguably the two greatest swimmers of all time," said U.S. national team director Frank Busch. "We should feel so lucky. Katie can be the face, I don't care. She can step right up."

As Ledecky said, "I don't know if anybody can ever match or carry the torch that Michael has carried for us the past 16 years, really. And I think collectively as a unit, you see how special this team is this week, and collectively, we'll try to fill that void."

And perhaps the most interesting thing of all, it's only the beginning.

"Stars emerge once in a while, and Katie and Michael are definitely two of them," said Leah Smith, who swam with Ledecky on the 4x200 relay team that won gold. "It's pretty crazy. And there is probably somebody working hard right now, seeing the examples they are setting, who is going to be just like them or maybe even be better than them."