But it didn't matter who was fastest. Just first.
Phelps swam into history with a magnificent finish Saturday, tying Mark Spitz with his seventh gold medal by the narrowest of margins in the 100-meter butterfly.
One-hundredth of a second, the time it takes lightning to strike the ground.
"Dream as big as you can dream and anything is possible," Phelps said. "I am sort of in a dream world. Sometimes I have to pinch myself to make sure it is real."
Call it the Great Haul of China - and it's not done yet. Phelps has one more race on Sunday, which will likely complete his coronation as the greatest Olympian ever.
Spitz already ceded the title.
"It goes to show you that not only is this guy the greatest swimmer of all time and the greatest Olympian of all time, he's maybe the greatest athlete of all time," said the icon of the 1972 Munich Games. "He's the greatest racer who ever walked the planet."
The finish was so close the Serbian delegation filed a protest and swimming's governing body had to review the tape down to the 10-thousandth of a second.
Phelps thought he lost - until he saw the "1" beside his name on the scoreboard.
"When I did chop the last stroke, I thought that had cost me the race," he said. "But it was actually the opposite. If I had glided, I would have been way too long. I took short, faster strokes to try to get my hand on the wall. I ended up making the right decision."
Phelps' time was 50.58 seconds, the only time in these Olympics that he won an event without breaking the world record.
Not to worry. The 23-year-old from Baltimore has now pulled even with the greatest of Olympic records.
"One word: epic," Spitz told The Associated Press from Detroit. "I'm so proud of what he's been able to do. I did what I did and it was in my day in those set of circumstances. For 36 years it stood as a benchmark. I'm just pleased that somebody was inspired by what I had done. He's entitled to every second of what's occurring to him now.
"I feel a tremendous load off my back."
Phelps will return on Sunday to swim in his final event of these games, taking the butterfly leg of the 400 medley relay. The Americans will be heavily favored to give him his eighth gold, leaving Spitz behind.
Phelps slapped his hands on the water and let out a scream after the astonishing finish. The crowd at the Water Cube gasped
- it looked as though Cavic had won - then roared when the "1" popped up beside the American's name.
Cavic's time was 50.59.
The Serbian delegation filed a protest, but conceded that Phelps won after reviewing the tape provided by FINA, swimming's governing body. USA Swimming spokeswoman Jamie Olsen said the tape was slowed to one frame every 10-thousandth of a second to make sure Phelps actually touched first.
It was impossible to tell on regular-speed replays.
"We filed the protest but it is already over," said Branislav Jevtic, Serbia's chief of mission for all sports. "They examined the video and I think the case is closed. The video says (Phelps) finished first.
"In my opinion, it's not right, but we must follow the rules. Everybody saw what happened."
FINA referee Ben Ekumbo of Kenya said there was no doubt who won after a review of the super-slow replay.
"It was very clear that the Serbian swimmer touched second after Michael Phelps," he said. "One was stroking and one was gliding."
Cavic still wasn't sure he actually lost, but said he would accept FINA's ruling.
"I'm stoked with what happened," Cavic said. "I don't want to fight this. People will be bringing this up for years and saying you won that race. If we got to do this again, I would win it."
Cavic watched the replay himself.
"It's kind of hard to see," he said. "I know I had a long finish and Michael Phelps had a short finish."
A notoriously slow starter - Phelps was seventh out of eight at the turn
- he really turned it on with the return lap, his long arms gobbling up huge chunks of water as he closed the gap on Cavic and fellow American Ian Crocker, the world record-holder.
As they approached the finish, with Phelps' head in line with Cavic's shoulder, the Serb took his final big stroke and glided underwater toward the gold. Phelps, his timing a bit off but fully aware of where he was, did another mini-stroke, propelling his upper body out of the water, swooping his arms in a huge circular motion and slamming the wall with his hands on the follow-through.
Phelps watched the replay on the video board, then saw it again in the massage area.
"I saw it slow down frame by frame," he said. "It's almost too close to see."
It was reminiscent of the 100 fly finish at Athens four years ago, where Crocker appeared to have the race won but Phelps got him at the wall by 0.04.
"I thought four one-hundredths was close and I was shocked then," Phelps said. "I'm even more shocked now than I was then. One-hundredth is the smallest margin of victory in our sport. I guess it's pretty cool."
Makes that 400 free relay, in which Jason Lezak chased down France's Alain Bernard to win by eight-hundredths of a second, look like a blowout.
"My last two Olympics I've been able to nail my finishes, and it's been by four one-hundredths and one one-hundredths," Phelps said. "I'm happy and kind of at a loss for words."
As if Phelps needed any extra motivation, his coach, Bob Bowman, took note of Cavic's reported comments a day earlier that it would be best for the sport if the American lost.
On their way to breakfast, Bowman brought it up.
"I wasn't going to at first, then I was saying to myself, 'This race is going to be very tight and I'm going to use everything I got,' so I put it out there," Bowman said, chuckling. "Maybe it was worth a hundredth."
"It fires me up more than anything," Phelps said. "I always welcome comments. It definitely motivates me even more."
Cavic didn't leave anything to chance, either. Right before the race, coach Mike Bottom shaved a few stray hairs off the back of his swimmer's neck, looking for any edge he could get.