RIO DE JANEIRO (AP) — Russia's dominance in rhythmic gymnastics remains as strong as ever. Yana Kudryavtseva's dominance of the sport's big-time meets, however, is over.

Margarita Mamun ended her Russian teammate's long run in major international competition during the Olympic all-around final on Saturday, taking advantage when a rare mistake by Kudryavtseva gave Mamun enough room to squeak by and wrest the gold from the three-time world champion. Mamun's total of 76.483 gave Russia its fifth straight Olympic gold in the rhythmic all-around and Mamun her first major title after spending most of the last three years as the runner-up to Kudryavtseva.

"It was quite unexpected for me to win the gold medal today because all the competitions Yana used to win," Mamun said. "I wasn't thinking about winning the gold medal. It just happened."

Mamun posted the top score during qualifying on Friday. The scores reset on Saturday and Kudryavtseva led through two rotations when she ran into trouble during her club routine, the event in which she posted the highest score in the 24-woman qualifying field a day earlier.

The 18-year-old tossed one of her two clubs high into the air inside Rio Olympic Arena as the music crescendoed to a finish. One problem: when Kudryavtseva reached out to grab the club, it wasn't there. Instead it bounced off the floor inches away from her outstretched hand. She left the podium fighting back tears, well aware gold had been lost.

"Sometimes at the end of the routine I think I'm relaxed, I think it's already in my hand and it's not," Kudryavtseva said.

Mamun wasn't aware of Kudryavtseva's mistake until she came out with a red ribbon in her hand during her final routine. Mamun glanced at the scoreboard for just a moment and saw her name in first. It stayed there after her dynamic routine — her ribbon in constant motion — secured a gold she never saw coming.

"I was really surprised to see Yana make a mistake," Mamun said.

Kudryavtseva gathered herself preparing for her final set but the misstep proved costly. She settled for second despite posting the highest score in the other three disciplines.

"It all happened very quickly," she said.

Ganna Rizatdinova of Ukraine earned bronze, capping a slow but steady rise from a 10th-place finish in London four years ago. The 23-year-old is Crimean by birth but competes for Ukraine after Russia annexed Crimea two years ago while she was training in Kiev. She considers her medal a victory for two countries.

"Since London my life has changed a lot, my way of preparation has changed a lot," Rizatdinova said. "Now I have grown up. I have new ambitions and new way of preparation and competing."