RIO DE JANEIRO (AP) — With one last chance for a gold medal in what's probably her last Olympics, Vivian Cheruiyot turned to — who else — Usain Bolt for a pre-race pep talk.

Guess what? It worked.

The Kenyan said she shared a few words with Bolt before her 5,000-meter final at the Olympic Stadium on Friday. Then she ran down world champion and heavy favorite Almaz Ayana to win a long-awaited first Olympic title. She also set a new games record.

"It was my fourth Olympic Games and I had not got gold," the 32-year-old Cheruiyot said. "Almaz can go fast ... Today I said, 'I am going to follow her. I am not going to lose her.'"

Ayana set a world record to win gold in the 10,000 meters a week ago and opened a big gap in Friday's 5K final. But the Ethiopian suddenly faded and Cheruiyot and Kenyan teammate Hellen Obiri saw their chance.

Cheruiyot surged, breezing past Ayana with around two laps to go to win in 14 minutes, 26.17 seconds, breaking an Olympic record that has stood for 16 years. Obiri followed home in second for silver, 3.60 seconds behind Cheruiyot for a Kenyan 1-2.

Ayana, who was tipped to have a crack at the 5,000 world record in the final after missing it by just a second in June, slumped and held on grimly for third in 14:33.59.

"I saw her, I saw she's not running smoothly and also she was slow," Cheruiyot said. "She was not going good and we were coming, and I said to Hellen, 'let's go, let's go. We are going to get something.'"

The victory gave Cheruiyot revenge for her second-place finish behind the Ethiopian in the 10,000 earlier in these games and finally put her on the top of the podium at her fourth Olympics, and after a silver and a bronze at London 2012, and another silver a week ago.

All three medalists crossed inside the former Olympic record of 14:40.79 set by Romania's Gabriela Szabo at the Sydney Olympics in 2000. Not surprisingly, the five top finishers were all from Kenya or Ethiopia.

The 24-year-old Ayana, completely dominant in the 10,000, was expected to challenge Ethiopian compatriot Tirunesh Dibaba's world record of 14:11.15 in the 5,000 final. Halfway through she had taken control after an early break by Japan's Miyuki Uehara and opened a big gap on the chasers.

But, on a warm night in Rio, Cheruiyot paced herself better, sinking Ayana's bid for a 5,000-10,000 double at her first Olympics.

Nikki Hamblin, the runner whose act of sportsmanship alongside American Abbey D'Agostino in the 5,000 meters heats warmed hearts at the Olympics, finished last in the final in 16:14.24 — still a personal best for the New Zealander.

"I went out there and I tried to compete, I tried as hard as I could," Hamblin said. "I hung on for a while and then the move came and I didn't have the legs."

The two were involved in one of the feel-good moments of the games when they collided in their heat and both tumbled. D'Agostino first helped Hamblin to her feet and encouraged her to finish the race. The American then realized she had sustained a bad knee injury. Hamblin returned the favor by helping her, and D'Agostino finished the race while grimacing in pain with torn knee ligaments.

Both runners were given a place in Friday's final because of the collision but D'Agostino didn't run because of her knee injury.

Hamblin said she'd now re-live the moment on TV.

"Probably have to go back and re-watch it and have a cry about it and relive the Olympic moment," she said.