Hamilton had topped practice during both sessions on Friday but Ferrari found their groove during FP3 on Saturday morning.
And they proved that form again in qualifying, Vettel pipping team-mate Kimi Raikkonen to pole position with both Mercedes relegated to the second row.
But the German pole-sitter revealed afterwards while standing on the home straight that he was worried about the cars on the even side of the grid – which will include Hamilton.
“We’ll find out tomorrow but it looks like on Kimi’s side there is more rubber so I will need a good start,” Vettel said.
It had looked as though Raikkonen would take pole after breaking the lap record for the Shanghai circuit.
The Finn, just as he had a week ago in Bahrain, was sitting pretty with the Ferraris half a second clear of Mercedes and Vettel his only realistic rival.
But the four-time world champion pulled more time out of the lap to take top spot by just eight thousandths of a second.
“I was happy with the whole lap, not just the last sector, but the car was really amazing,” Vettel added.
“It just kept getting better. I knew that the first lap I had some mistakes and lost the rear in the exit of Turn Three and then in Turn Six again so I was a bit beaten up.
“But I knew that if I got a tidy lap I had a little bit of margin and I could push.”
And while the battle between Ferrari team-mates Raikkonen and Vettel is an intriguing one, F1 fans were also treated to a performance that saw reigning Constructors’ champions held under the cosh.
“This is the turning point,” former F1 world champion Damon Hill told Sky Sports.
“For so long we have seen Mercedes dominate. They’ve had the party mode in Qualifying but now both Ferrari cars are ahead of Mercedes.
“Hamilton looked a little out of sorts, good performance from Valtteri.
“I thought Kimi had it in the bag. That was such a perfect lap that I didn’t think anybody could do better than that. But Sebastian Vettel showed his class.”