The Welshman won in an uphill sprint from Team Sunweb’s Tom Dumoulin and AG2R La Mondiale’s Romain Bardet at the end of the 175.5km stage from Bourg-Saint-Maurice.
Thomas’ Sky team-mate Chris Froome was just behind in fourth with Movistar’s Mikel Landa fifth.
The quintet had attacked and counter-attacked one another on the way up one of cycling’s most famous climbs but were back together in the final few hundred metres, before Thomas accelerated out of the last bend to take the stage win for the second straight day.
“Not even in my wildest dreams did I think I would win on here,” Thomas said. “It’s one of those things that will stay with me for the rest of my life.”
Thomas won by just a couple of seconds from Dumoulin, with Bardet one second behind him and Froome a further second back.
With bonus seconds applied, Thomas extends his lead in yellow over Froome by 14 seconds to one minute and 39 seconds, with Dutchman Dumoulin a further 11 seconds back.
It was a second Tour mountain stage win in a row for Thomas following Wednesday’s victory in La Rosiere, and his third career Tour stage win.
His lead over Froome may have grown, but Thomas once again repeated that the four-time winner is Sky’s leader here.
“Like I said yesterday, I’m still riding for Froomey,” Thomas said. “Froomey is still the man. He knows how to ride for three weeks. Legend gets used way too much but he’s probably the best ever so I’m just going to enjoy this.”
Froome was slapped by one spectator and appeared to be spat at by another as he faced some of the lingering ill-feeling from the salbutamol case in which he has been cleared of wrong-doing.
The defending champion briefly turned to remonstrate with the man who hit out at him with around seven kilometres to go, but will be happy to have made it up safely.
Nowhere do the crowds get more up close and personal than they do here, and 2014 winner Vincenzo Nibali paid a price as he hit a spectator and crashed while with the lead group.
Thomas had actually appeared in danger of losing yellow at the mid-point of the stage, with LottoNL-Jumbo’s Steven Kruijswijk, who started Thursday two minutes and 41 seconds down, enjoying a lead of more than six minutes as he went clear of the day’s breakaway.
The Dutchman hit the bottom of Alpe d’Huez with a lead of four minutes 18 seconds but the gap began to tumble as the gradient bit, and he was caught with 3.5km to go.
Landa, Bardet, Froome and Dumoulin all tried moves off the front as the ski resort came into view, but they were all together on the final bend before Thomas burst forward.
A second tough mountain stage took its toll with sprinters Dylan Groenewegen, Fernando Gaviria – both of whom had won two stages in this Tour – joining Andre Greipel in abandoning the Tour to leave the field of quickmen much reduced before an expected sprint on Friday.
Geraint Thomas rode his way into the yellow jersey with a memorable victory on Stage 11 of the Tour de France to La Rosiere.
The Team Sky rider attacked six kilometres from the top of the final climb of this 108.5km stage from Albertville to claim his second career Tour stage win.
His mission when he first made his move was to catch rival Tom Dumoulin, the Team Sunweb rider who was looking to make his own gains in the General Classification.
But when former team-mate Mikel Nieve slid into view, trying to win the stage from the breakaway, another prize was on offer and Thomas kicked again, passing the Mitchelton-Scott man inside the final 400 metres.
Team-mate Chris Froome came third, alongside Dumoulin, some 20 seconds later in a pretty much perfect day for Team Sky as they made up time on their rivals.
Thomas now leads by one minute 25 seconds from Froome, with Dumoulin a further 19 seconds back in third place.
It is a second spell in yellow for Thomas after he held it for four days of last year’s Tour following victory in the opening time trial in Dusseldorf.
Though the sight of Sky massed on the front of the peloton most of the day was not one to excite fans, Thomas delivered the stage win with panache.
With BMC’s Greg Van Avermaet struggling off the back of the peloton by the midpoint of the stage on the Col du Pre, the battle for yellow was on.
Movistar’s Alejandro Valverde tried a long-range attack, while Dumoulin attacked on the descent of the penultimate climb, the Cormet de Roseland, linking up with Valverde before the road rose up again towards La Rosiere.
But Sky kept their powder dry until Thomas launched his move. Froome initially held back, marking counter-moves from AG2R La Mondiale’s Romain Bardet and UAE Team Emirates’ Dan Martin before leaving them both behind and catching Dumoulin.
Martin showed attacking intent and tried to break away from the chasing group with 10km to go, but was quickly reigned in on the descent of the Col de la Colombiere.
Keen to limit the time gap, the Stage 6 winner pushed up the final kick to secure a respectable seventh place and remain in the hunt overall in 17th place – five minutes off the pace.
Frenchman Julian Alaphilippe (Quick-Step Floors) won the stage after breaking away early and looking in full control as he crossed the line 01:34” in front of his nearest rival.
Greg Van Avermaet extended his lead in yellow to more than two minutes with a superb ride.
The BMC rider crossed the line fourth on the stage but one minute 39 seconds ahead of the main group of contenders, which included Team Sky’s Chris Froome and Geraint Thomas, plus Adam Yates of Mitchelton-Scott.
That saw the Belgian extend his overall lead to two minutes and 22 seconds over Thomas, with Movistar’s Alejandro Valverde up to third.
Irishman Martin said: “It’s nice to get the first one out of the way. It’s always a bit nervous after the rest day. I’m pretty happy with that. It was a block head wind (on the final climb), every bone in my body said don’t attack.
“But I knew if guys were five or 10 seconds off the back, by the time we reach the bottom it could be one minute. The next two days are going to be brutal and I’ll see how my legs are – but I expect a lot more attacks tomorrow.”
There will be little time for riders to recover as they look ahead to another tough day in the mountains and battle a 108.5km route from Albertville to La Rosiere.
These parcours have already featured on this year’s UCI World Tour – as part of Stage 6 of the Criterium du Dauphine – so will be familiar to many of the riders.
Martin picked up a top five finish on that stage in June so will be hopeful of a strong performance as he hunts a second Tour de France stage victory.