Luka Pibernik's exploits during stage five of the Giro d'Italia on Wednesday will be remembered for a long time — but perhaps for all the wrong reasons.

The Slovenian Bahrain-Merida rider was preparing to enter the final lap of the circuit but it appeared he forgot to read the cycling rulebook.

Pibernik thought he had already entered the last lap and believing he was about to take the stage victory having had a comfortable lead over his rivals, he raised his arms in celebration when he crossed the line.

Luka Pibernik sprints ahead of his rivals during the penultimate lap of Giro d'Italia stage five

But the Bahrain-Merida rider mistakenly celebrated believing he was approaching the finish

It seems the 23-year-old didn't hear the bell and unfortunately he was made to look a bit silly as his rivals closed down the gap with around 5km of the stage remaining.

The unlucky rider will want to put his howler behind him after finishing in 148th spot, 20 seconds adrift of stage winner Fernando Gaviria following his mistake.

Gaviria snatched his second win on this year's Giro d'Italia when he sprinted to victory in impressive fashion in Wednesday's fifth stage.

Slovenian Pibernik raised his arms in celebration when he crossed the finish line

He was made to look a bit silly as his rivals closed down the gap with around 5km of stage to go

The Colombian rider of the Quick Step-Floors team, who had already prevailed on stage three, easily beat Italian Jakub Mareczko (Wilier Triestina-Selle Italia) and Ireland's Sam Bennett (Bora-Hansgrohe) at the end of a 159-km route from Pessara to Messina, the home town of defending champion Vincenzo Nibali.

Gaviria will wear the points classification's cyclamen jersey on Thursday as his team mate, Luxembourg's Bob Jungels, retained the overall leader's maglia rosa.

Thursday's sixth stage takes the peloton over 217km from Reggio Calabria to Terme Luigiane.

Pibernik finished in 148th spot, 20 seconds adrift of winner Fernando Gaviria (pictured)