– Simone Biles isn’t much for crying. Sunday night, even after the world’s top gymnast earned a score that put her on the Olympic team, she wasn’t going to shed a tear until Martha Karolyi confirmed she had finally achieved her sport’s biggest prize.

“Even though everyone said I’m a lock, I didn’t want to believe it until I heard Martha say it,” Biles said. “That’s when it’s real. And I wasn’t going to celebrate until Martha came into the room.”

Once the U.S. women’s national team coordinator delivered the news, Biles let the tears flow. She made the Olympic team for the first time, earning the lone automatic place on the roster by capturing the all-around title at the Olympic trials. She ended the two-day competition at SAP Center with a score of 123.250, cementing her status as the favorite to win all-around gold in Rio.

At the end of a brutally stressful meet, though, the 19-year-old Biles and the four others chosen for the team — Laurie Hernandez, Aly Raisman, Gabby Douglas and Madison Kocian — wept both for themselves and for others. Maggie Nichols of Little Canada, Biles’ best friend, did not make the team or the list of three alternates despite placing sixth in the all-around.

Nichols missed significant training time after arthroscopic knee surgery in April, an injury that occured at the worst possible time. She hit all four of her routines Sunday and finished with 117.600 points. But Karolyi, the head of the selection committee, said Nichols’ scores were not high enough.

Biles said she was proud of Nichols, and that it would be hard not to have her with the group in Rio. The three alternates are MyKayla Skinner, who was fourth in the all-around standings; Ragan Smith, who was fifth; and Ashton Locklear, a specialist on uneven bars, the event in which the U.S. all-rounders are the weakest.

Karolyi said the five were the same ones she has had on her list for weeks. The Olympic team was chosen based on performances at the trials and at the U.S. championships last month. Karolyi said then she had five names in mind and was unlikely to be swayed.

Douglas, though, made it a test. The 2012 Olympic all-around champion was a favorite to make the team but has been ragged in training and competition for several weeks. Sunday, she fell off the balance beam — just as she did Friday, on the opening day of the competition — and finished seventh in the all-around standings, just behind Nichols. Douglas was emotional after the selections were announced.

“When I fell, I was like, ‘This is not good,’ ” said Douglas, who finished third on bars — a score that cemented her place on the team, despite her problems on the beam. “The wait [for the team to be named], was kind of long, and it was very nerve-racking.”

Karolyi said Nichols was a victim of the sport’s merciless mathematics. At the Olympics, three gymnasts perform on each apparatus in the team competition, and all three scores count. Karolyi has emphasized that to win a team gold, she must select the five gymnasts who can combine for the highest scores — and not simply the five with the highest all-around scores.

Though Nichols hit all four of her routines, Karolyi said, her scores did not place her in the top three in any event. She was fourth on floor, fifth on vault, eighth on beam and ninth on bars. All five members of the team and all three alternates had a top-three score in at least one event.

“The selection is based on three up, three count,” Karolyi said. “If you look up her scores on every single event, her score is not factoring in, not even one time in the three up, three count. That’s harsh, but that’s what it is.”

Nichols and her coaches, Mike Hunger and Sarah Jantzi, were not available for comment after the team was announced.

Hernandez was second in the all-around standings with 121.150. Raisman, a 2012 Olympian, was third with 119.750. Kocian won her place by finishing first on bars both nights, earning a score of 15.900 Sunday.

Biles opened with a breathtaking floor routine, soaring on her tumbling passes as if she had springs on her feet. That set a tone for a competition much like Friday’s, in which every gymnast crackled with so much energy that they barely remained controlled. The first three on floor exercise — including Biles — all went out of bounds Sunday, demonstrating the difficulty of harnessing their adrenaline on a day they had trained toward for years.