The CCC rider had been on the attack all day and he narrowly held off a late chase from Victor Campenaerts (NTT) to take the biggest win of his career, and provide CCC with a farewell victory before they leave the sport at the end of the season.
Campenaerts went solo to try and bridge to the lone leader and finished second on the stage with Jacopo Mosca (Trek-Segafredo) winning the sprint ahead of early break, crossing the line in third place. Australian Simon Clarke was fourth on the stage.
The main drama of the stage came just after the start, with riders stopping and then piling into team buses for a later point in the stage where the race would restart.
"We were standing in the start line and the organiser said we could shorten it a bit," said stage winner Cerny of the stoppage. "It was very nice because we had the last three days really heavy and it was a hard day, especially with the rain.
"I'm really happy. I was lucky in the breakaway. We were working together. In the final, it was just who had the better legs. I'm really happy. I still don't believe it. It was so quick, it's incredible. I can't describe it."
In the race for the maglia rosa, Wilco Kelderman (Sunweb) maintained his slender 12 second lead over his teammate Jai Hindley, with Tao Geoghegan Hart (Ineos Grenadiers) remaining a further three seconds down.
The win came after farcical scenes at the start of the race due to a dispute between the riders and the race organisers, RCS Sport. The peloton, exhausted from the race, the long transfers, and the early starts were uncomfortable with the notion of then tackling the longest stage (258 kilometres) of the Giro in poor conditions.