Vinales had come close to dropping out in the first segment, but would instead prevail in an close Q2 shoot-out, his hopes of a first pole since Aragon last year aided by crashes for Marc Marquez and Johann Zarco.
While the track had been too wet for slicks all throughout the first three practice sessions, the pre-qualifying FP4 session finally marked a change in conditions, allowing for the final pole contest of the year to take place in the dry.
Marquez had topped FP4 comfortably, yet crashed three corners after starting his first flying lap in Q2, rolling through the gravel at Turn 4 at speed - and while he was on his feet swiftly, he was in obvious pain, holding his left shoulder.
Rossi announces decision to retire at end of season
As the champion hitched a ride back to the pits and prepared to venture back out, Pramac Ducati's Danilo Petrucci had taken a commanding lead, ending the first runs four tenths clear of nearest rival Alex Rins with a 1m31.531s.
But Vinales lowered the benchmark by two tenths as he began his second run, before posting a marginal improvement to end up on a 1m31.312s - which in the end proved good enough for pole.
Dani Pedrosa (Honda HRC), Danilo Petrucci (Ducati Pramac) - GP of valencia 2018
Image credit: Getty Images
Suzuki's Rins came closest to deposing the Yamaha man, but settled for second, seven hundredths off, securing his first front-row start in the premier class.
Ducati's Andrea Dovizioso was up on Vinales' benchmark on two separate laps in the dying minutes of the pole shoot-out, but had to contend with third, while Petrucci settled for fourth, just 0.102s off the pace.
Zarco was another major threat to Vinales, and was some three tenths up on the Spaniard's pole effort heading into the final sector when he crashed out and was resigned to 11th.
Marquez had rejoined the track with six minutes left on the clock and vaulted himself up to the middle of the second row, while Pol Espargaro took a phenomenal sixth place for KTM.
His brother Aleix was a strong eighth for Aprilia, behind Suzuki's Andrea Iannone - who had followed Vinales on track in Q1 and ultimately dominated the session - and ahead of Honda's Dani Pedrosa.
Petrucci's Pramac team-mate Jack Miller crashed for the fourth time in five sessions in Valencia and thus could do no better than 10th, while Ducati wildcard Michele Pirro finished 12th behind Zarco.
Valencia GP : interview de Dovizioso après la qualification
Image credit: Eurosport
Jorge Lorenzo, making his return to MotoGP qualifying after an absence imposed by injury, mounted a surprise challenge for Q2, ultimately ending up half a tenth short of the final transfer spot occupied by Vinales.
LCR Honda rider Takaaki Nakagami was likewise a threat to the Yamaha rider but also came up short and will start 14th.
Valentino Rossi did not have the pace in the dry in FP4 or Q1, and missed the pole shoot-out for the third time this season, sandwiched between the Marc VDS Hondas of his protege Franco Morbidelli and Moto2-bound Tom Luthi in 16th.
Britons Bradley Smith and Scott Redding, who as with Luthi are bowing out from their full-time MotoGP rides, could do no better than 22nd and 24th respectively.
Savadori to take over from Smith for Aprilia in last three MotoGP rounds
Valentino Rossi tests positive for Covid-19