Clary, who narrowly missed making the 2008 team in three events, rallies in the final 50 meters and finishes second to Michael Phelps in the 200-meter butterfly.

OMAHA — Tyler Clary was halfway through his race, and that shopping trip sure looked like a waste of money.

His sister and his girlfriend spent Thursday afternoon buying dresses and shorts for London. Clary had not yet qualified for the Olympics, but surely that would be a matter of time.

Or not, considering the 200-meter butterfly at the U.S. trials had 50 meters to go, with Clary in fourth place.

"I was thinking damage control," said his mother, Stacy. "I was just going into mom mode."

Her son went into beast mode over those final 50 meters, passing two competitors to finish second and earn his first Olympic invitation. Michael Phelps won the race, clinching his ticket to London in a third event.

If Phelps is the star attraction on the U.S. swim team, Clary is something of the heartbreak kid. At the 2008 trials, Clary finished one spot shy of an Olympic bid in one event and two spots shy in another. In his first event here, he again missed by one.

And, when he hit the wall Thursday, he thought he had finished third — one spot shy, one more time. He looked up at the scoreboard, and never in his life had second place been more rewarding.

"It's the biggest endorphin rush you could ever experience," said Clary, who lives in Riverside.

He was not the only Southern California swimmer to leave the pool with a smile on his face. Jason Lezak, the Irvine resident who preserved Phelps' chance at eight gold medals at the 2008 Olympics, had another swimmer preserve his first chance to qualify for London.

Lezak, 36, swam a record time on the final leg of the 400 freestyle relay to give the United States a come-from-behind victory in Beijing. His chance at an encore had been all but extinguished when he posted the ninth-best time Thursday in the semifinals. The top eight advance to the finals Friday.

Lezak promptly sidled up to Ryan Lochte, who had the fifth-best time.

Said Lezak: "Are you going to scratch for me?"

Lochte said he would — he and his coach already had decided two other events Friday would be enough — and got a drawn-out thank you from Lezak.

"He better owe me something," Lochte joked.

Lochte, Phelps and Matt Grevers, who won the 100 backstroke Wednesday, all dropped out of the 100 freestyle. Since all three have qualified for London in other events, the trio remains eligible for the 400 freestyle relay team in London.

Four other Olympic spots were decided Thursday, highlighted by Allison Schmitt setting an American record in winning the women's 200 freestyle. Missy Franklin finished second to secure the other Olympic berth in that event, and Caitlin Leverenz and Ariana Kukors placed 1-2 in the women's 200 individual medley.

For Phelps, making the Olympic team is almost routine. After Clary had finally accomplished that goal, Phelps offered him a hug.

"It's pretty cool to make your first one," Phelps told Clary.

"You have no idea how good that feels," Clary replied.

Phelps could have guessed, if only by glancing at Clary's mother frantically galloping out of the stands to her son.

"I thought she was about to have a heart attack," Clary said. "I don't think I've ever seen her move so fast."

Stacy Clary was happy to talk, and to hug, and to cry, all at the same time.