During the apparatus final in freestyle, Jordan Chiles finished in fifth place. But after an appeal during the final from her coach Cecile Landi, which was approved, the 23-year-old finished in third place.
Romanian Ana Bărbosu was bumped down to fourth place and was inconsolable after the verdict.
Romania also filed an appeal after the competition to the Court of Arbitration for Sport (CAS), which has now been approved.
The arbitration court found that the American's appeal was submitted late, four seconds too late to be exact.
Following CAS's decision – which the International Gymnastics Federation has backed – Chiles is being moved back to fifth place, and Bărbosu has been awarded the bronze medal after all.
The International Olympic Committee (IOC) has confirmed, following CAS's decision, that Chiles will have to return her bronze medal, which will instead be awarded to Bărbosu.
The IOC is in discussions with the Paralympic Committee about organizing a ceremony afterwards for the Romanian gymnast.