Sainz led the way after the first Q3 runs on the Hungaroring and as his Ferrari team-mate Charles Leclerc failed to beat his time, Sainz then improved again to seemingly cement a certain pole position.
But Sainz's bid for a second career pole was thwarted in the dying seconds of the top-10 shootout by Mercedes' George Russell, who took a shock maiden pole.
Having lost out on pole by only 0.044s, Sainz said he was disappointed to be beaten by Russell as he branded his own final run as "nothing special".
"Probably that Q3 run two lap was nothing special. It was not good enough for pole so I'm also a bit disappointed because with the perfect lap, for sure I would have been up there," Sainz said.
"But I guess George did a very good lap today and he deserves that one, so congrats."
Sainz, who had been lagging behind Leclerc earlier this season as he tried to adjust the Ferrari more to his liking, said his qualifying performance did point to a better understanding in the car.
"I felt like today I had everything more or less under control through the whole qualifying," he explained.
"We keep making steps in the right direction, which keep getting me more comfortable and more together with the car and today there were some good laps."
After struggling through Friday practice, Russell said he was left in the dark about Mercedes' race pace, saying he would be "shocked" if Mercedes could keep up its level of performance from qualifying during Sunday's grand prix.
With Saturday's FP3 rained out, which washed away the track's rubber, Sainz said Ferrari was in the same boat and he felt the changing track conditions on Saturday afternoon affected Ferrari's pace advantage on its rivals.
"Clearly the track conditions as they've switched, particularly on soft tyres, maybe they haven't gone in our direction because yesterday we seemed to have a pace advantage that we certainly didn't have today," Sainz explained.
"Even in Q1 and Q2 we didn't have margin that we had in other races this year and we had to make sure we put our set of new tyres [on] and do it at the right time, because the midfield was certainly closer to us than where they were yesterday.
"We are certainly not particularly happy about today, the way the car and everything was handling, but with a perfect lap I could have put it up there so that's why I'm disappointed."