The Spaniard was part of a four man sprint but beat UAE Team Emirates’ Rui Costa, Cannondale’s Pierre Rolland and Astana’s Tanel Kangert.
Fraile made an early move as he rode away with fellow Spaniard Mikel Landa of Team Sky and together the pair maintained a sizeable lead over the peloton until 40km from the finish.
As the two were caught, several riders attacked on the on the slopes as the final climb of the day approached.
Rolland made his move and made a solo breakaway only to have Fraile catch him, and in the process take the maximum KOM points.
Fraile and Rolland worked well together on the descent and kept a 20 second lead over the chasing group as they took on the last 20km.
In the final kilometres, Costa and a few others joined the front two.
Despite his earlier efforts, Fraile’s legs held and after getting on the wheel of Costa, he was able to produce a powerful sprint to end off the day.
“When Landa attacked, I thought it might be a good idea to follow and see what happened,” said Fraile.
“We then got caught again and while the others were attacking on the last climb, I just kept my own pace and managed my effort until I was near the top and then I attacked.
“In the sprint, I knew Rui Costa was the man to beat. However, I’m also fast and I had very good feelings in my legs today,” said the 26-year-old.
“I’d dreamed about a win like this for a long time. It’s great to finally pull it off.
“This is my first win at the Giro d’Italia. It always feel special to race in Italy because I won my first race here – the Giro dell’Appennino.”
He is now level with Jan Polanc in the maglia azzura classification.
After winning the tenth stage Tom Dumoulin, who finished in the third chasing group, continued to retain the maglia rose.