Katie Ledecky checks her time after the women’s 1,500-meter freestyle in Tokyo on Sunday. (Koji Sasahara/AP)

Katie Ledecky breezed to victory in her final race of the Pan Pacific championships, an event that was to serve as a preview of sorts not just for next year’s world championships but also the 2020 Olympics. And it was an eye-opener in more ways than one, as Ledecky reminded the world of her aqua supremacy, and the world showed her that some capable challengers just might be coming of age.

Ledecky’s blowout win in the 1,500-meter race Sunday meant she finished the year’s biggest meet with three individual gold medals (400-, 800- and 1,500-meter freestyle races) and a bronze (200), plus a silver with the United States’ 4×200 relay team. But perhaps most noteworthy, the Pan Pacs event in Tokyo featured some of the stiffest competition – and closest races – that Ledecky has seen on an international stage.

“I have a lot of things I learned from this meet, a lot of areas for improvement and a lot of motivation,” Ledecky told reporters in Tokyo on Sunday. “Just going to hold onto those things and take them back into training in the fall.”

On Saturday, Ledecky won the 400 with a blistering time of 3:58.50, the sixth fastest in history. It was also the closest 400 she’s ever raced internationally, as Ariarne Titmus, a 17-year-old Australian, touched the wall just 1.16 seconds later. For the sake of comparison, when Ledecky first broke the 400 world record four years ago at the Pan Pacs, her margin of victory was 6.18 seconds, and two years ago at the Rio Olympics she won by 4.77 seconds. Titmus became just the third female swimmer to break the vaunted four-minute barrier.

“It’s exciting for me to see how I put the standard out there, and I know there are a lot of girls chasing that,” Ledecky said. “It’s good to see someone get under it. It’s going to push me to go even faster and set the benchmark even higher.”

Two days earlier, Ledecky, 21, suffered her first third-place finish on an international stage, trailing a pair of 18-year-old swimmers to the wall in the 200-meter freestyle race. Canada’s Taylor Ruck set a meet record, finishing in 1:54.44, which was 0.41 seconds ahead of Japan’s Rikako Ikee and 0.71 better than Ledecky.

It was the nightcap on a grueling 800-200 double on the meet’s opening day, and Ledecky fared better in the 4×200 relay the next night. Even though the Americans settled for silver, Ledecky almost reeled in Australia’s Maddie Groves, posting a 1:53.84 split on her anchor leg.

A new generation of swimmers might be trying to announce themselves, but in Tokyo Ledecky showed that at the longer distances she is as dominant as ever. She posted a 8:09.13 finish in her 800 win – the fifth fastest ever and 7.94 seconds better than anyone else in the Pan Pacs pool. And in Sunday’s 1,500, she won with a time of 15:38.97, more than 21 seconds ahead of the second-place finisher, Kiah Melverton of Australia. It was well short of the world record Ledecky set in May (15:20.48) but still stands as the 10th-best time ever posted in the event.

“It was a tough four days of competition,” Ledecky said Sunday. “Swimming the range of events that I swim, it’s hard to put together all great races. But there are a lot of great things I can take away from this meet.”

While young swimmers might be emerging to challenge Ledecky, particularly in the shorter distances, the Washington-area native also sees opportunity to lower her own times. She plans to be faster — and better rested — when she returns to Tokyo for the Olympics in two years.

Conditions at the Pan Pacs were not ideal, as the U.S. team decided to land in Tokyo only four days before the competition began, barely enough time to shake off the jet lag and adjust to a 16-hour time difference for those coming from the West Coast, such as Ledecky. She said the travel arrangements put the Americans in a “challenging position.”

“It was a little harder than all of us anticipated,” Ledecky told reporters, “but I think we’re learning a lot for 2020. I think we’ll apply what we learned moving forward.”

In all, the Americans won 29 medals at the Pan Pacs meet, which featured 19 countries around the Pacific Ocean. By comparison, the U.S. team totaled 33 at the Rio Games and 38 at last year’s world championships, facing competition from far more countries.

The Americans posted no major records in Tokyo, and even one of their biggest wins turned out to be a loss. The United States’ men’s 4×100 freestyle relay team was the top finisher in Friday’s race but was later disqualified because two of its competitors swam out of order.

Ledecky, a five-time Olympic champion, was the only swimmer, male or female, to win three individual titles in Tokyo, but her three gold medals also marked the fewest she’s brought back from an international competition since she was a 15-year-old competing at the 2012 Olympics. At the Pan Pacs meet four years ago, Ledecky set two world records and won five gold medals. She knows the bigger Tokyo meet is waiting just two years down the road.

“Two years is still a good amount of time,” she said. “The exciting thing, I think, for me is that this meet… decided our world championship team for next year. So I really get to train really hard, and I know what I have coming at the end of the season next year without any pressure of qualifying for any meet moving forward.”

More on the Olympics:

‘I straight wanted to die’: Michael Phelps wants USOC to help athletes cope with depression

Sally Jenkins: The Olympic flame has been extinguished. The U.S. Olympic Committee should be next.

Jerry Brewer: For two weeks in South Korea, we were a unified team

America’s gay Olympians hope ‘gay Olympians’ won’t be a thing to talk about in 20 years