SAN JOSE, Calif. — Soon after Danell Leyva’s feet hit the earth on his dismount from the parallel bars — his last event on Saturday at the United States Olympic gymnastics trials — he knew he had completed what he had set out to accomplish, and what his family had set out to do.

Leyva, 20, who came to the United States from Cuba just before he was 2, had just won the Olympic trials and clinched one of two guaranteed spots on the United States team for the London Games.

As he stepped off the competition floor, his stepfather and coach, Yin Alvarez, bowed in front of him three times before Leyva was able to trap him in such a huge bear hug that it lifted Alvarez in the air. A second later, Leyva planted a tender kiss on his mother, Maria Gonzalez, who had tears in her eyes.

“It’s crazy to say, I’m going to the Olympics,” Leyva said, as his eyes welled, too.

Not far away, the 19-year-old John Orozco, who clinched the other Olympic berth, sat stunned. He said he didn’t care that Leyva had just beaten him with a score of 368.350 points after four days of competition at the national championships and trials. All he could think about was London.