Maya DiRado gets a hug from Elizabeth Beisel, left, after winning the women's 400-meter individual medley at the U.S. Olympic swimming trials on Sunday. (Mark J. Terrill/Associated Press)

Maya DiRado was in an unusual position Sunday night at the U.S. Olympic swimming trials, cruising over the final 100 meters of the exhausting 400-meter individual medley, able to consider all that went into the moment and all that lies ahead.

“Thoughts crossed my mind like: This is not real life,” she said. “Like: I’m imagining this. I’m still in my nap or something.”

DiRado, though, won the 400 IM final and earned a spot in what will be her first — and last — Olympics. The 23-year-old Californian has vowed that, even though swimmers now routinely compete professionally into their late 20s and through several Olympic cycles, she will retire from the sport in exchange for a life with her new husband and a job at McKinsey & Company, an elite management consulting firm.

DiRado swam collegiately at Stanford, and this is her third trials, but her winning time of 4:33.73 left Elizabeth Beisel, who qualified for her third Olympic team, more than three seconds behind. DiRado’s performance comes in a year when she improved dramatically — but remained steadfast that no achievement will sway her from stepping away from the sport.

“Some people see it as, ‘Oh, you’re swimming so well, so why not keep going?’ ” DiRado said Saturday before the competition began. “But I think part of the reason why I am swimming so well is knowing that I have a hard stop date, and so it’s much easier to be excited about all of this and give it everything I have when I know that this is my last go-through.”

DiRado, then, will be in an interesting spot in Rio de Janeiro when the Games begin, living in two worlds.

“I’ll be a rookie; I’ll do the rookie skits,” she said. “But at 23, I’m one of the older ones. And [there will be] just a sense of calm, and because this is my last one, I feel like I’ll try to help people appreciate what they’re doing.”

One competitor DiRado didn’t have to beat out for one of the two spots on the team: Bethesda’s Katie Ledecky, who scratched out of the 400 IM, as expected. Ledecky will make her 2016 trials debut Monday in the 400 freestyle, an event in which she holds the world record.

Bayer makes 100 fly final

Cassidy Bayer, a 16-year-old from Alexandria who swims for the Nation’s Capital Swim Club, surprised herself by placing fourth overall in Sunday night’s semifinals of the 100-meter butterfly and qualifying for Monday night’s final.

“I wasn’t expecting it,” she said after her time of 58.11 placed her third in her semifinal. Four-time Olympic gold medalist Dana Vollmer, who qualified for her first Games when Bayer was 4, was fastest in 56.90.

This is Bayer’s debut at the trials, but she said her approach has been simple: Have fun.

“I’ve learned when to turn it on and off when it comes to fun,” she said. “I love these girls. I know a lot of them really well. But when it comes to the blocks, no one’s my friend.”

Bayer would have to finish first or second in Monday’s final to reach Rio. “I know I can swim 57 [seconds],” she said. “It’s just, how do I get it done?”

Jaeger rallies in 400 free

For eight months, Connor Jaeger struggled with his performance and attributed it to one thing: “Getting old,” the 25-year-old said. When he dove into the pool for the final of the 400 freestyle, he was trying to be optimistic, but he “honestly had no idea where it was going to land.”

It landed with a personal best of 3:43.79, a come-from-behind victory over 2012 Olympian Conor Dwyer and a spot in Rio even though he and Dwyer trailed Texan Clark Smith nearly the whole race.

“At the 200 mark, I was thinking, ‘Wow, I’m out of this,’ ” he said. “ ‘This is kind of going to be embarrassing.’ ”

Instead, it was exhilarating. Jaeger has clinched his spot in Rio with his best event, the 1,500-meter freestyle, still to come. . . .

Tyler Clary, the reigning Olympic gold medalist in the 200 backstroke, sneaked into the 400 IM final with the eighth-fastest qualifying time in the morning prelims but decided to scratch out of the final to focus on the rest of his program — the 200 free, 200 butterfly and 200 back. . . .

Kevin Cordes broke an American record in a semifinal of the 100 breaststroke, posting a time of 58.94, breaking the previous mark held by Eric Shanteau.