A runner's premature celebration ended up costing him the whole race.

Tanguy Pepiot of the University of Oregon could see the finish line and was certain that he had the victory in the clear.

In triumph, he waves to the crowd, hoping to rile them up for a loud win.

>> Read more trending stories  

Except that moment of distraction gave his competitor, Merson Simon of University of Washington, the exact leverage he needed to pull in front of Pepiot.

With a burst of speed, Simon passes Pepiot just in time to cross the finish line first.

"I thought he had me," Simon tells The Oregonian,  "I thought he was so far ahead. Then I heard the crowd get crazy. And then he started throwing his hands up, and I thought, 'I don't think he knows I'm coming.' I think it was about 5 meters to go [when I caught] him, and he still had no idea."

"I just wanted to celebrate winning in front of our crowd," Pepiot continues, "I was excited about it. But the race wasn't over ... It wasn't very smart. But it was a learning experience."

An announcer comments on Pepiot, "no one has to tell him anything. You see his face and you know he will never do anything like this again."

Despite the gutting loss, the two runners still shared a congratulatory hug after it was all over.