Ruben Guerreiro has become the first Portuguese rider to win on the Giro d'Italia in 31 years by claiming the ninth stage, a 208-km mountain ride from San Salvo.
His compatriot Joao Almeida has also retained the overall leader's Maglia Rosa despite losing time on other top contenders in the steepest, final part of the last ascent.
Australia's Jai Hindley, who came home 10th on the stage, jumped from 11th to ninth place overall, while his compatriot Lucas Hamilton finished seventh on the day.
The EF-Education First rider Guerreiro beat fellow breakaway rider Jonathan Castroviejo (Ineos-Grenadiers) of Spain by jumping away in the last 300 metres of the final climb to clinch victory by eight seconds.
The previous Portuguese rider to win a stage on the Giro had been Acacio Da Silva in 1989.
"Finally, what a great satisfaction after so many second places," the 26-year-old Guerreiro said. "The team and I really deserved this victory. It was very difficult to get into the breakaway this morning and it's extraordinary to win today."
Guerreiro also revealed that he lives close to Almeida in Portugal and the two families are good friends.
Almeida, who rides for the Deceuninck-Quick Step team, enthused: "I'm happy for my compatriot Guerreiro, he deserves the win!"
Mikkel Bjerg was third, 58 seconds behind Guerreiro. All three had been part of an original eight-man breakaway group before Guerreiro and Castroviejo attacked on the summit finish, a first-category climb.
Almeida, a member of the Deceuninck-Quick Step team, is now 30 seconds ahead of Dutch rider Wilco Kelderman, who leapfrogged Pello Bilbao into second spot in the overall standings. Hindley is 1:15 down on the lead.
It was a difficult stage for the peloton. The route featured two second-category and two first-category climbs on a very wet and cold day.
The Giro has its first rest day on Monday before Tuesday's 10th stage, an undulating 177-kilometre route from Lanciano to Tortoreto.