Aly Raisman closed a memorable run at the London Olympics with her second gold medal Tuesday, winning the gold medal in floor exercise to add to the balance-beam bronze she won earlier in the day and the gold she shared with the U.S. team.

It was powerful affirmation of Raisman’s hard work and dedication after laboring so long in the shadow of her more decorated American teammates, Gabby Douglas and Jordyn Wieber. Raisman closes her Games with three medals. Douglas, who finished seventh on the balance beam, won a pair of golds. And Wieber, one.

After gaffes by several contenders, the only gymnast in position to bump the 18-year-old Raisman from the top spot was Sandra Raluca Izbasa of Romania, the defending Olympic champion on the floor, who went last. But on the final tumbling pass of what had been an elegant, impressive routine, the Romanian landed short and fell face-first on the mat, clinching the gold for Raisman, who posted a score of 15.600.

Romania’s Catalina Ponor took silver (15.200). And Russia’s Aliya Mustafina claimed  bronze (14.900).

The Olympics ended on a sad note for Wieber, 16, who had only one chance to earn an individual medal to go with the U.S. team gold she shared. But Wieber stepped out of the mat’s boundaries on her second tumbling pass, incurring a penalty from the judges, and finished with a 14.500 points, struggling to hold back tears.

Nine days earlier, the reigning world all-around champion had missed the cut for the Olympic all-around finals as the third-best American on the day. Countries are limited to two finalists each. And Wieber hadn’t competed since.

Douglas, 16, bows out of the Games with two gold medals — sharing the team title and winning the sport’s most coveted title, the individual all-around. But her efforts to add to that total ended in disappointment as she finished eighth in the uneven bars final Monday and seventh on the balance beam today, incurring a rare fall on the apparatus.

China went 1-2 in the event as Linlin Deng won gold 15.600) and Lu Sui took silver (15.500). Raisman’s routine originally garnered a 14.966, placing her fourth behind Romanian Catalina Ponor. But an appeal was filed and upheld and Raisman’s score was bumped up to 15.066 points, giving her the bronze medal. Douglas scored 13.633.

But despite what she called a “disappointing” conclusion to her first Olympics, the 16-year-old “Flying Squirrel” has two golden reasons to celebrate.

“’Olympic all around’ is going to be attached to my name,” she said. “I’m in the history books.”

Raisman’s brilliance on the mat came less than an hour after suffering the high and lows of Olympic competition during the appeal process. But when the new results were posted, the crowd cheered for the American who helped lead her team to gold last week.

It was a reversal of fortune for Raisman, who five days prior tied Russia’s Aliya Mustafina for third but missed out on a bronzemedal when Mustafina won the tiebreaker.

The floor exercise final traditionally concludes the Olympics gymnastics competition and is a fan favorite, mixing artistry with athleticism.

Matt Brooks contributed to this report.