Two-time former world champion Vivian Cheruiyot of Kenya rained on Ethiopian Almaz Ayana's bid for an Olympic distance double, kicking with two laps to run to seal gold in the women's 5000m on Friday.
Cheruiyot, who won silver in the London Games four years ago, timed a new Olympic record of 14min 26.18sec, with teammate Hellen Obiri taking silver in 14:29.77.
Ayana, who set an amazing world record to win the 10,000m earlier in the week, had to be happy with bronze.
World 5,000m champion Ayana looked to be on the way to another dominant victory after surging into a huge lead four laps into the race but the Ethiopian tired in the closing stages and was unable to hold off Cheruiyot's late surge.
Cheruiyot had to settle for silver earlier in the 10,000m in one of the greatest ever long-distance races, saying afterwards she would be Olympic champion one day.
The 32-year-old stayed true to her word in the 5,000m final and did not panic when Ayana burst into the lead, winning Kenya's first ever medal over the distance and cementing her legacy as her country's most decorated female athlete.
Kenyan Hellen Onsando Obiri clocked a personal best of 14:29.77 to take silver behind Cheruiyot, who is a four-times world champion over 5,000m and 10,000m.