SAINT-DENIS, France — American Cole Hocker pulled the upset of the Olympics on Tuesday night, beating his personal-best time by almost 3 seconds to outrace favorites Jakob Ingebrigsten and Josh Kerr for the title at 1,500 meters.

Hocker won the race in an Olympic-record 3:27.65, pulling from fifth to first over the final 300 meters to take down the two runners whose rivalry dominated the buildup to the much-anticipated race.

“This may be an upset to a lot of people, but if you’ve been following my season, you knew I was capable of it,” Hocker said. “But still, things had to go my way today.”

Hocker, a 23-year-old product of University of Oregon, was listed as much as a 30-1 long shot for this race. He beat Kerr by .14 seconds, while Ingebrigtsen, who set the pace through the first 1250 meters, ended up in fourth behind American Yared Nuguse.

About an hour after that surprise came an American victory most people saw coming when Harvard graduate Gabby Thomas powered through the curve to win the 200-meter title in 21.83 seconds. Her .25-second margin over Julien Alfred was .11-seconds bigger than Hocker’s even though Thomas raced half a lap and Hocker nearly four.

Hocker, who recorded his previous personal best of 3:30.59 at Olympic trials this summer, notched the first U.S. win in the metric mile since Matt Centrowitz took gold in 2016.

This is the first time Americans put two men on the 1,500-meter podium since the Stockholm Games in 1912.

“I kind of figured it would be fast,” Hocker said. “I figured Ingebrigtsen would want to take it out of guys like me. But I knew I hadn’t been tested at this level yet, and I knew I was capable of being as strong as any of those guys out there.”

All eyes for this one were trained on Ingebrigtsen, the defending champion out of Norway who came in with a point to prove, and Kerr, the Scotsman who beat him last year at world championships.

Ever since that win, Kerr and Ingebrigtsen poked at each other. Among the salvos that stuck was Kerr’s assertion that Ingebrigtsen only won races with pacesetters, the likes of which are not allowed at major races like this.

Against that backdrop, Ingebrigtsen darted to the front quickly and ran there for the first 3 1/2 laps, while Kerr traded between second and third, getting ready for his typical windup and a potential slingshot past the Norwegian over the closing stretch, much the way he did last year.

“Of course, it’s a tactical error that I’m not able to reduce my pace the first 800,” Ingebrigtsen said.

While he and Kerr were wearing each other out, Hocker, at 5-foot-9 1/2 and more than 3 1/2 inches shorter than the top two contenders, almost looked like he was trying to photo bomb the end of this race.

As they entered the homestretch, he snuck up on the inside once, only to have Ingebrigtsen block that move.

So, Hocker fell back and wound up for another try with about 50 meters left. Both he and Kerr, who was racing on the outside, passed Ingebrigtsen, then Hocker beat the Scot to the finish line, first with a look of disbelief on his face, but then thumping his chest twice to celebrate a win no one saw coming — maybe except for him.

Thomas added a gold to the bronze she took home in the event from Tokyo three years ago.

The 27-year-old Harvard graduate, who has a Masters in public health, took the lead for good at the curve and was never challenged in the final stretch. She let out a shout and grabbed her head with both hands after crossing the line.

Thomas beat 100-meter champion Julien Alfred of St. Lucia by 0.25 seconds, while Brittany Brown of the U.S. got the bronze, 0.02 seconds in front of Dina Asher-Smith of Britain, who was just another hundredth of a second ahead of teammate Daryll Neita.

Out of three sprints so far on the purple track at Stade de France, the Americans have picked up two golds: Thomas followed Noah Lyles in the men’s 100 to the top step of the podium.

After she earned her degree at Harvard in neurobiology and global health, Thomas enrolled at the University of Texas, where she studied sleep patterns of different ethnic groups — while also making the wise choice to double down on her track training.

That paid off big-time in front of a packed house Tuesday, when she came in as a favorite, especially after reigning world champion Shericka Jackson of Jamaica dropped out because of an apparent injury.

And this one really wasn’t even close, it turned out.

Even Alfred, who won the first Olympic medal for her island country in the 100 three nights earlier, didn’t stand a chance against Thomas on this night.