Olympic swimmer Michael Phelps’ much-hyped “race” against a great white shark finally aired on Sunday night.

WARNING: SPOILERS BELOW!

The competition was featured in Discovery’s “Phelps vs Shark: Great Gold vs Great White,” as part of its famous “Shark Week” summer programming.

In the end, Phelps was able to swim 100 meters off South Africa in 38.1 seconds -- but the shark won with a time of 36.1 seconds.

However, he wasn't actually racing next to the shark. Discovery Channel staffers calculated the great white's time and compared it to Phelps' performance, according to SI. On the broadcast, an image of a shark was superimposed over the Olympic swimmer.

The swimmer earlier told Fox News the challenge was “probably the hardest race I’ve ever had.”

Ahead of the Sunday night event, Phelps told ABC News' "Good Morning America," “We're not in the water at the same exact time. I think that's the one thing we all - we want everyone to know — I was safe, which was number one. I had 12 to 14 divers underneath me when we were doing the race.”

MICHAEL PHELPS SAYS GREAT WHITE WAS TOUGHEST FOE EVER

Phelps wore a wetsuit that was 1 millimeter thick, as well as a monofin -- which essentially acted as a tail. “I don’t like taking silver medals, but I’ll take one to a great white,” he said during the Discovery program.

Phelps tweeted Sunday, “Rematch? Next time.. Warmer water.”