Chris Froome was penalised 20 seconds for taking food in the final 5km of stage 18 but still extended his lead in the Tour de France by 37 seconds.
With Froome struggling on the second climb of the Alpe d'Huez, his team-mate Richie Porte dropped back to the team car to get an energy bar for Froome.
Porte broke the rules, but Froome was also docked time by race commissaires.
France's Christophe Riblon won the showpiece 18th stage for the first home win of this year's race.
Despite a rare sign of weakness, Froome finished 57 seconds ahead of second-placed Alberto Contador and, even after his time penalty, extended his overall lead over the Spaniard to five minutes 11 seconds.
The Tour marked its 100th edition by climbing the iconic Alpe twice in the same day for the first time in its history.
Froome attacked and dropped Contador at the start of his second ascent of a mountain steeped in Tour history, but needed help from Porte after running out of energy before reaching the end of the climb through the Alpe's famous 21 switchbacks.
"It was a difficult stage," Froome said. "When I signalled for help, I needed sugar and I was thankful that Richie was there."
Colombia's Nairo Quintana attacked as Froome refuelled, and finished one minute six seconds ahead of him, enough for the Tour debutant to move third overall, just 21 seconds behind Contador.
"I still haven't won a stage yet but I am very happy with my performance," said Quintana, who tightened his grip on the white jersey, for the best-placed rider aged 25 or under.
By the time the race reached the Alpe for the first time, Froome had already come under pressure from Contador's Saxo Tinkoff team-mates, who set a furious pace in the first hour of the 172.5km stage.
Froome was briefly isolated from his Team Sky team-mates but kept his cool and also remained calm when Contador attacked on the descent of Col de Sarenne, the twisting mountain pass which linked the two ascents of the Alpe.
Contador pulled 20 seconds clear of Froome at one point, but was caught after a bike change before reaching the bottom of the Alpe for the second time.
As the riders battled up the Alpe again, through hundreds of thousands of fans, Froome launched his attack and Contador could not respond.
At that point, Froome looked as strong as he did when he won the previous two mountain-top finishes on this year's Tour, at Ax 3 Domaines and on Mont Ventoux, but this time he could not stay with Quintana or Joaquim Rodriguez.
Ahead of them, the last three survivors of a nine-strong break that escaped early in the day were battling it out for the accolade of a stage win on top of the Alpe.
Riblon, who crashed into a stream on his way down Col de Sarenne, took the honours, overhauling a tiring Tejay van Garderen with the American less than 2km from the finish.
"To raise my arms aloft at L'Alpe d'Huez is incredible,'' Riblon said. "With five kilometres to go, I thought I had lost it.''
Froome has just 447km (277 miles) of the Tour's total distance of 3,404km (2,115 miles) between him and the finish line on the Champs-Elysees on Sunday, but he must survive two more days in the high mountains of the Alps before the procession into Paris.
Friday's stage sees the riders go up four more tough climbs - including the Col du Glandon and Col de la Madeleine - as part of a 204km (129-mile) route from Le Bourg-d'Oisans to Le Grand-Bornand.
"It is possibly the toughest day of the Tour de France," said Froome.
Results of stage 18:
1. Christophe Riblon (France/AG2R) 4:51:32"
2. Tejay van Garderen (U.S./BMC Racing) +59"
3. Moreno Moser (Italy/Cannondale) +1:27"
4. Nairo Quintana (Colombia/Movistar) +2:12"
5. Joaquim Rodriguez (Spain/Katusha) +2:15"
6. Richie Porte (Australia/Team Sky) +3:18"
7. Chris Froome (Britain/Team Sky) +3:18"
8. Alejandro Valverde (Spain/Movistar) +3:22"
9. Mikel Nieve (Spain/Euskaltel) +4:15"
10. Jakob Fuglsang (Denmark/Astana) +4:15"
11. Alberto Contador (Spain/Saxo - Tinkoff) +4:15"
12. Roman Kreuziger (Czech Republic/Saxo - Tinkoff) +4:31"
Overall standings after stage 18:
1. Chris Froome (Britain/Team Sky) 71:02:19"
2. Alberto Contador (Spain/Saxo-Tinkoff) +5:11"
3. Nairo Quintana (Colombia/Movistar) +5:32"
4. Roman Kreuziger (Czech Republic/Saxo-Tinkoff) +5:44"
5. Joaquim Rodriguez (Spain/Katusha) +5:58"