STUTTGART, Germany — Simone Biles won a record 21st medal at the world gymnastics championships on Tuesday as the United States retained its women’s team all-around title.

It was Biles’ 15th career gold and broke a tie with Russian gymnast Svetlana Khorkina for the most medals overall by a woman at the world championships. She’s now two short of Vitaly Scherbo’s all-time record of 23 among men or women.

“Every year it feels better and better just because we’re adding to the legacy,” Biles said. “I feel like I never think of records. I just go out there and do what I came to do, which is compete for the country.”

The U.S. team scored 172.330 points to beat second-place Russia by 5.801 points and win its seventh consecutive team title at an Olympics or world championships.

The reward for winning was a battery-powered medal that lights up when it senses movement. Biles called it “the sickest medal we’ve ever had.”

Biles posted the best individual scores on the vault, balance beam and floor.

“I think if I do the routine that I did tonight I’ll be more than happy” in Thursday’s individual all-around final, she said.

A fall for Sunisa Lee on balance beam in her world championship debut and a fumbled routine from Grace McCallum on the uneven bars left the U.S. with room for improvement, though both were strong on other apparatus.

“It’s just so surreal to come out here and end up on top with the strength of the team that we have, even after having a couple falls out there,” Biles said.

Russia became the first team to get within six points of the U.S. since China at the 2015 world championships, something which pleased Russian gymnast Angelina Melnikova.

“We’re happy that we got second because we can’t battle the Americans just yet, but today the gap was significantly lower than at the last few world championships,” Melnikova said.

Biles said other teams were “most definitely” closing in on the U.S.

“All of the teams have improved their difficulty over the last quad, and I think that’s really exciting to see the strength that they have.”