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.

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.”

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.