He will now be looking to convert pole to a win and extend the slender one-point lead he has over Hamilton in the world championship.
Steady work from Vettel to take a deserved pole position in the end, locking up the front row with his colleague Kimi Raikkonen.
Hamilton said he was not surprised by Ferrari's overnight leap in performance.
"You can't overtake here". During his first run in the final session of qualifying, Hamilton ran wide at Turn 4 and off the circuit, leadng him to back out of his first attempt.
The German, who leads Mercedes driver Hamilton by a single point ahead of the last race before the August break, lapped the Hungaroring circuit in one minute 17.017 seconds on supersoft tyres. He believed he had over-worked the tyres in the first part of the lap.
The Scot, who had never driven a 2017 auto before and faced the monumental task of getting to grips with it in a matter of minutes, qualified an impressive 19th and ahead of Sauber's Marcus Ericsson. He had been quickest in Q1 and although Hamilton was top of the timing in Q2, when it mattered in the final session Vettel put in a flawless lap, exploiting a auto with which he was absolutely in tune. Mind, the same applied to his team-mate Lance Stroll.
Massa withdrew after feeling unwell and dizzy. He had dialled-in the auto and was fully up to speed by the final run on Saturday morning where he was quickest in final practice.
But the problem recurred in final practice and he decided he had to pull out of the race. Di Resta placed 19th, relegating Sauber driver Marcus Ericsson to last. "The temperatures are expected to rise tomorrow, which means that we really need to get the rear end of the vehicle more stable". I have gone out and done what I could. "[Going straight into qualifying] was like jumping off a cliff and fighting for survival".
Charlie Gard's parents ask court to let him die at home
Michio Hirano, a neurology expert at New York's Columbia Medical Center and from the Vatican's Babino Gesu pediatric hospital. The child's life support is expected to be pulled in the next few days.
Behind, Nico Hulkenberg was "best of the rest" for Renault in seventh, although team-mate Jolyon Palmer had another miserable day, twice bringing out the red flags.
Happy birthday Fernando: Fernando Alonso hasn't had much to shout about this season and it's unlikely eighth position in qualifying on his 36th birthday will warrant much celebration.
There's been a few British one-race wonders for Williams. The Toro Rosso of Daniil Kvyat finished in 13th with Romain Grosjean's Haas in 15th. Not forgetting Martin Brundle (1988) and Damien Macgee (1975).
"I don't think there was any moment that we had a shot of pole", he said.
"I can't tell you what it's going to feel like because I'm going to get that pole at some stage", Hamilton said of Schumacher's record. "But that's the way it goes and at least I am on the second row". Everyone here, we know what we have to do and that's what we plan to do.
"A clean race is a good race and then we'll see which result we get".
"We can't follow or overtake a auto that is as fast or faster", said the Briton.
It will also be the first time since last year's Italian GP that he would be leading the title race.