Tom Dumoulin retained the pink jersey after a 161 km ride from Florence to Bagno di Romagna that saw the Dutchman and his Sunweb team pushed all the way before he maintained his overall race lead of 2min 23sec on 2014 champion Nairo Quintana (Movistar).
Italy's two-time and defending champion Vincenzo Nibali (Bahrain), who saw teammate Franco Pellizotti crash but get back on his bike, remains fifth overall at 2:47 as the contenders for the "maglia rosa" look forward to two days of comparative rest on stages 12 and 13, which are more suited to sprinters.
The overall victory hopes of Sky rider Thomas, whose bid more or less ended when he lost over five minutes in a crash on Saturday, now look conclusively over after the Welshman finished 2min 25sec in arrears to drop to over six minutes behind Dumoulin.
Despite his significant advantage following victory in the 10th stage time trial on Tuesday, Dumoulin had to rely on his team to chase down and control a number of attacks.
He was quick to pay tribute, giving Sunweb and in particular rider Laurens ten Dam the thumbs-up as he crossed the finish line to thank them for keeping the threats to a minimum.
"We expected a really hard fight today, and it was," said Dumoulin, who pushed Quintana into second when he finished 49secs ahead of second-placed Thomas on Tuesday.
"We expected guys to attack on the first climb, and they did. All I can do is thank my team. They always kept it within distance. It was a really good day, I'm really happy."
He added: "Laurens is our old warrior, he's getting better with age. Like a good wine."
With over 4,000 metres of climbing on the stage, the attacks came thick and fast but mountain man Fraile seized the day.
He managed to join Sky rider Mikel Landa in a two-man breakaway and when they were eventually reeled in by a counter-attacking group containing Portugal's former world champion Rui Costa, the Spaniard did well to keep some powder dry.
Their three-man lead group increased to four in the final kilometres when Tanel Kangert (Astana) tagged along with less than two kilometres remaining.
The Estonian launched a bid for stage victory in the final kilometre and, for a brief moment, it looked like the four leaders would be thwarted when the peloton came over the horizon with 400 metres to race.
But Fraile, 26, countered, driving for the finish inside the final 200 metres to cross the line in triumph.
"I've been waiting for this day for a long time," said Fraile, a former winner of the Tour of Spain's King of the Mountains jersey.
"I marked Rui Costa at the end because I knew he was the strongest of our bunch. It's a victory I've been dreaming of for many years."
At 229 km, the 12th stage on Thursday is the longest on the race, although after two manageable climbs the sprinters teams will be expected to set their fast men up for a bunch sprint.
1. Omar Fraile (ESP/DDD) 4hr 23min 14sec,
2. Rui Costa (POR/UAE) same time,
3. Pierre Rolland (FRA/CAN) s.t.,
4. Tanel Kangert (EST/AST) s.t.,
5. Giovanni Visconti (ITA/BAH) s.t.,
6. Ben Hermans (BEL/BMC) s.t.,
7. Dario Cataldo (ITA/AST) s.t.,
8. Simone Petilli (ITA/UAE) s.t.,
9. Maxime Monfort (BEL/LOT) at 03sec,
10. Laurens De Plus (BEL/QST) s.t.
1. Tom Dumoulin (NED/SUN) 47hr 22min 07sec,
2. Nairo Quintana (COL/MOV) at 2min 23sec,
3. Bauke Mollema (NED/TRE) 2:38,
4. Thibaut Pinot (FRA/FDJ) 2:40,
5. Vincenzo Nibali (ITA/BAH) 2:47,
6. Andrey Amador (CRC/MOV) 3:05,
7. Bob Jungels (LUX/QST) 3:56,
8. Tanel Kangert (EST/AST) 3:59,
9. Domenico Pozzovivo (ITA/ALM) 4:05,
10. Ilnur Zakarin (RUS/KAT) 4:17