Briton Geoghegan Hart was the freshest man at the end of the final ascent, a punishing 14.5-km effort at an average gradient of 7.8%, to beat Dutchman Wilco Kelderman by two seconds.
Kelderman's Sunweb team mate Jai Hindley of Australia was third, four seconds off the pace, after pacing the leading trio up the climb.
Portuguese Almeida came home fourth, 37 seconds behind the winner. He retained the overall race leader's Maglia Rosa jersey, with a 15-second lead over Kelderman.
It was a bad day at the office for double champion Vincenzo Nibali, however, who dropped to seventh overall, 3:29 behind Almeida after cracking with 8.8 kilometres left on the last ascent.
Ineos-Grenadiers lost team leader Geraint Thomas to a crash early in the race, but they can now count on Geoghegan Hart to mount a challenge in the final week.
The 25-year-old jumped to fourth overall, a distant 2:57 off the pace. But his apparent superiority on Sunday made him a force to be reckoned with, with three more summit finishes left in the race.
Monday is a rest day on the Giro. (Writing by Julien Pretot; Editing by Hugh Lawson)