Gino Mader climbed to the first professional victory of his career on stage six of the Giro d'Italia and Attila Valter took over as the race leader on Thursday.
Mader gave Bahrain Victorious a much-needed lift a day after their team leader Mikel Landa crashed out of the race.
The 24-year-old Swiss was among six riders who made a breakaway on the 160-kilometre route from Grotte di Frasassi on a miserable rainy day.
That group was increased to eight, but there was one man who went on his own up the 15km final ascent to the finish in Ascoli and it was Mader who went away to take the win.
Mader attacked with 3.3km to go in grim weather conditions and there was no catching him as he finished 12 seconds ahead of Egan Bernal, also taking over as the leader of king of the mountains.
His victory ensured for the first time in Giro history riders from different countries have won the opening six stages of the race.
Groupama-FDJ rider Valter took the maglia rosa from Alessandro De Marchi, becoming the first Hungarian to have that honour.
Valter leads Remco Evenepoel by 11 seconds, while 2019 Tour de France champion Bernal is only 16 seconds adrift of the new leader in third place.
Bernal showed no sign of the back problem that has troubled him, making a late attack to drop some of his general classification rivals after receiving great backing from his INEOS Grenadiers team-mates a day after Pavel Sivakov was forced to abandon the race.
1. Gino Mader (Bahrain Victorious) 4:17:52
2. Egan Bernal (INEOS Grenadiers) +0.12
3. Dan Martin (Israel Start-Up Nation) +0.12
4. Remco Evenepoel (Deceuninck–Quick-Step) +0.12
5. Giulio Ciccone (Trek–Segafredo) +0.14
1. Attila Valter (Groupama-FDJ) 22:17:06
2. Remco Evenepoel (Deceuninck–Quick-Step +0.11
3. Egan Bernal (INEOS Grenadiers) +0.16
1. Giacomo Nizzolo (Team Qhubeka Assos) 72
2. Elia Viviani (Cofidis) 68
3. Tim Merlier (Alpecin-Fenix) 58
King of the Mountains
1. Gino Mader (Bahrain Victorious) 26
2. Geoffrey Bouchard (AG2R Citroen Team) 18
3. Vincenzo Albanese (Eolo–Kometa) 18