The Tinkoff-Saxo rider followed in the tyre tracks of compatriot Zenon Jaskula - who won Poland's first ever Tour stage win at Pla d'Adet in 1993 - en route to extending his lead in the polka dot jersey competition.
A series of stinging attacks on the final ten-kilometre climb saw Majka surge past Italy's Giovanni Visconti (Movistar) to cross the line with a 29-second winning gap - enough time for the 24-year-old to wink at the camera in the final kilometre before celebrating wildly with the crowd.
Race leader Vincenzo Nibali (Astana) once again kept his cool to take more time of each of his main rivals, the Italian crossing the line for third place on the 124.5km stage, 46 seconds down on Majka.
Spain's Alejandro Valverde (Movistar) recovered from a slight wobble on the decisive ascent to finish tenth on the stage. Valverde nevertheless conceded 49 seconds to Nibali to drop to more than five minutes behind the yellow jersey on the overall standings.
French youngsters Thibaut Pinot (FDJ) and Romain Bardet (Ag2R-La Mondiale) struggled on the hairpinned ramps to Pla d'Adet to lose ground in their battle for a podium finish in Paris. Pinot stays in third place but is now only eight seconds ahead of Jean-Christophe Peraud after Ag2R's French veteran shadowed Nibali up the final ascent to take a solid fourth place at the summit.
It was Majka's second victory of his debut Tour following his maiden victory at Risoul in the Alps on Sunday. Coming one day after Australian veteran Mick Rogers won in Bagneres-de-Luchon, it also marked Tinkoff-Saxo's third win of the race following the shock withdrawal of their overall hope Alberto Contador to a broken leg.
"I'd like to thank my team who work so hard for me all the time - especially Nicolas [Roche] who was excellent," said Majka. "Now I have my second win and the polka dot jersey so I'm happy."
Majka was joined by team-mate Roche in a large 20-man break that formed early in a short but sharp stage that included three other Cat.1 ascents, including the famous Col de Peyresourde.
Asked if Majka - a last-minute addition to Tinkoff-Saxo's Tour squad following the suspension of Roman Kreuziger - had surprised him with his performances in the race, Roche was very clear.
"No, he has not surprised me at all," said Roche, who crossed the line in ninth place, 1:25 behind his team-mate. "He is in the form of his life. We totally trust him and are completely dedicated to him. Today he is one of the best riders of the peloton and two stage wins in his debut Tour is exceptional."
FAST START: A group of eight riders extricated themselves after just two kilometres of racing, including the oldest man on the race, Jens Voigt (Trek), and Europcar pair Cyril Gautier and Yukiya Arashiro. Leading the chase, the Katusha team of Joaquim Rodriguez ensured that the gap never crept above the minute-mark as the peloton recorded a zippy average speed of over 50kmph for the first flat hour of racing.
Rodriguez attacked on the first of four climbs, the Cat.1 Col du Portillon, to spark the creation of a select chase group including the likes of Majka, Roche, Visconti, Pierre Rolland (Europcar), Bauke Mollema (Belkin), Vasil Kiryienka (Sky) and Frank Schleck (Trek). The chasing group swept up the initial break and Rodriguez crossed the summit in pole position to move back into the lead in the polka dot jersey competition.
After a fast descent, Kiryienka attacked ahead of the feed zone in Luchon to open up a gap ahead of the Col de Peyresourde. The Belorussian rode a high tempo to open up a two-minute lead on the climb, with Roche and Jose Herrada (Movistar) edging ahead of the chasing group near the summit. The pair crossed the summit 1:15 down on Kiryienka, with the peloton containing Vincenzo Nibali crossing some five minutes in arrears.
Kiryienka was caught near the summit of the third climb, the Cat.1 Col de Val Lourdon-Azet, with Rodriguez edging Majka for maximum KOM points just as he had done on the previous climb when crossing the line for fourth place.
By now, the select group of GC favourite were 2:45 down on the escapees - and Romain Bardet decided to press on the descent to the final climb, opening a gap of 25 seconds on Nibali and his other rivals. Roche, Rolland, Visconti and Amael Moinard (BMC) had reached the foot of the final ascent ahead of the other escapees - and it was Visconti who made the first attack, only to have his move expertly covered by Roche.
Back with the chasing riders, Majka made his move with 8km remaining - surging clear of Rodriguez, Schleck and Jon Izagirre (Movistar) despite controversially pulling on a motorbike antenna (an act that caused Rodriguez to wave his hand in protest).
Majka closed in on the riders up the road, catching Rolland, Moinard and Roche, before riding off in pursuit of Visconti. The pair combined until the final 3km when Majka made his final attack.
Further down the road, Bardet had been caught by the other favourites, prompting team-mate Peraud to put in an attack which left Valverde reeling. With the Spaniard dropped, Pinot and Bardet joined forces with Tejay Van Garderen (BMC) as they tried to follow the pace of Nibali and Peraud.
But Valverde managed to regain his composure - not only catching the trio, but passing them in the closing stages to extend his lead over the other podium pretenders, but lose yet more ground on Nibali, who is looking more and more like the 2014 Tour de France champion by the day.
RIDE OF THE DAY: His Belgian push-style hand sling on the motorbike antenna aside, Rafal Makja underlined once again what a quality bike rider he is. With two winks to the camera in the closing 8km, it's clear that the Pole has got over his initial annoyance at having to ride for his team this July.
DAY TO FORGET: Joaquim Rodriguez and his Katusha team buried themselves to reel in the early break - and when Purito took a raft of KOM points over the first three climbs of the day, it looked like the Spaniard would be back in polka dots for stage 18. But Majka's victory after Rodriguez crumbled on the final climb means his rival picked up a massive 50 points at the summit - and puts the Pole in pole for the polka dots in Paris.
COMING UP: Thursday's final day in the Pyrenees is a 145.5km monster that takes the riders up the mythical Col du Tourmalet ahead of a showdown finale on the Hautacam.
STAGE IN A SENTENCE: Superb solo win by winking Majka puts the Pole in pole for polka dots.
- Sports & Recreation
- Vincenzo Nibali
- Joaquim Rodriguez
- Romain Bardet