LONDON — The big stage did not swallow Chad Le Clos in its floodlights, but he was in the dark when it came to finding his way out. Michael Phelps was there, as he has been for the past decade, to show the way.

During the parade of medalists, Le Clos, 20, of South Africa, was the one with tears in his eyes and the Olympic gold medal around his neck after handing Phelps his first major international defeat in the 200-meter butterfly since the Pan Pacific Championships in 2002. Le Clos was timed in 1 minute 52.96 seconds, five-hundredths ahead of Phelps, who was nearly a second off his winning time in 2008 of 1:52.03.

“To be honest, I didn’t really think that I was going to win the race,” Le Clos said. “Just very proud. The race for me was more than an Olympic final. Ever since the 2004 Olympics, Michael’s always been an inspiration to me and a role model.”

As they made their way around the pool deck and posed with their medals, Le Clos said Phelps told him “to enjoy the moment because it’s really special” and explained the best way to negotiate the next half-hour because neither swimmer was done for the night.