Majka struck his four remaining breakaway companions early on La Pandera, 10 kilometres from the finish.
The Polishman held off the fast approaching group of GC favourites, Miguel Angel Lopez (Astana) crossing the line 27 seconds later, Vincenzo Nibali (Bahrain-Merida) and Froome close behind.
Majka's win offers him some consolation after crashing out of the Tour de France and the dashing of his Vuelta GC ambitions through illness.
“I am so happy," Majka said. "But not just for me, also for my team BORA – hansgrohe. In the beginning of this Vuelta we suffered a lot, when the whole team had some stomach virus. My GC hopes were gone after just a few stages.
"But we all kept on fighting, never surrendered. With three podiums, we already had some strong results, but finally we got the win we wanted so desperately.
"I knew I had to go early with all the big guys chasing behind. But my legs were really good today and I could control the race from the front on the last 10 kilometres.
"In the end I took this important win for my team BORA – hansgrohe. Now, with my legs finally coming good, I will try to take another stage in this very tough last week of the Vuelta."
The GC battle
Behind Majka, the GC favourites skirmished. Romain Bardet (AG2R) was the first to fire with around four kilometres from the finish. Esteban Chaves (Orica-Scott) soon followed but ultimately paid for his panache.
"I attacked between four kilometres to three to go because I watched a video this morning and I knew it's the hardest part of the climb," Chaves said. "But after the attack, I paid for that and lost some time at the finish line."
"I think there wasn't one guy in the peloton that wasn't suffering."
The disappointed Colombian finished ninth after failing to respond to a counter-attack from Froome, who'd easily paced himself back to Chaves, now joined by Lopez, Nibali and Alberto Contador (Trek-Segafredo).
"I think the best tactic was by (Astana's) Miguel Angel Lopez (who attacked with two kilometres to go), and also Stevo (sport director Neil Stephens) told me that tactic, but I didn't listen and went on feelings," Chaves said, slipping to fifth overall.
While Nibali's third place rewarded him with a four-second improvement in time, he remains second on GC.
"We're all trying, but Froome is very strong," the Italian said.
"He's proved it. He's had a great team supporting him. In the last climb we could try something different. Astana worked very well, Contador too."
Froome never panicked and was happily paced by Wout Poels until the dying kilometres.
"I was very much in control with Wout and also thinking a little bit about tomorrow as that's a massive day," Froome said. "It's going to be explosive and we're expecting fireworks."
How it unfolded
After much battling for 25 kilometres, 10 riders finally succeeded in breaking away.
Majka, Patrick Konrad (Bora-Hansgrohe), Alexis Gougeard (AG2R-La Mondiale), Simon Clarke, Davide Villella (Cannondale-Drapac), Rui Costa (UAE Team Emirates), Bart De Clercq (Lotto-Soudal), Luis Angel Mate (Cofidis), Stefan Denifl (Aqua Blue Sport) and Ricardo Vilela (Manzana Postobon) all soon enjoyed a maximum gap of seven minutes and 40 seconds with 90 kilometres to go.
Hard-working Bahrain-Merida and Trek-Segafredo controlled the pace back in the bunch and reduced the time gap to four minutes with 40 kilometres left to race.
KOM leader Villella was ably assisted to the points atop the first two climbs by Aussie team mate and past Vuelta KOM winner, Simon Clarke.
“I did it with the help of Simon Clarke who won that jersey in the past (in 2012)," Villella said.
"Climbing the last hill on a slow rhythm, we spoke about how to win this classification at La Vuelta. I have a good advisor here."
But by the time the race reached the bottom of La Pandera, just Majka, Konrad, Costa and De Clercq remained.