Slovenian rider Luka Pibernik has been left somewhat red-faced after his howler on stage five of the Giro D'italia on Wednesday.

Pibernik, who rides for the Bahrain-Merida team, mistakenly thought he had won stage five, crossing the finishing line and triumphantly raising his arms to the bemusement of all present.

Unfortunately for Pibernik, he had not heard the bell, and it seems his counting abilities had forsaken him as he celebrated his win when, in fact, he still had an entire lap of the race still to complete.

The 23-year-old apparently thought he had already entered the last lap and was strangely coasting to victory completely unchallenged by the chasing pack.

The lead that Pibernik built up vanished quickly as he was reeled in with about 5 kilometers of the stage left to run.

Eventually, when he did cross the finish line having completed the right amount of laps, the Slovenian was in 148th place, 20 seconds adrift of the leaders, having seen his day turn from glory to ruin in a matter of minutes. 

Pibernik will be eager to put this gaffe behind him as quickly as possible so he can focus on the rest of the race, but he could find himself as the butt of quite a few jokes in the coming weeks.

Victory on the day was claimed by Colombian Quick Step Floors rider Fernando Gaviria, who claimed his second win on the tour so far this year as he sprinted home.

You can watch Pibernik's massive error in the video below.

Very, very embarrassing.

Having already claimed the win on stage three, Gaviria easily bested Italian Jakub Mareczko (Wilier Triestina-Selle Italia) and Ireland's Sam Bennett (Bora-Hansgrohe) on the 159-kilometer fifth stage route from Pessara, to defending champion Vincenzo Nibali's hometown, Messina.

Giaviria's teammate Bob Jungels of Luxembourg managed to hang onto the overall lead, meaning Gaviria will wear the points classification's cyclamen jersey going into the 217-kilometer sixth stage.