Bottas said: "It was close, like it has been all week". "They're probably hiding the game or something". It is a shame it is only four-hundredths, but it is good for the team. "We got through all our running and we were quite fast compared to previous years, but we've still got some work to do overnight".
"And I am sure there have been people with nerves over the last few races, just not really understanding [what's happening] and feeling like we're not really learning enough". Vettel did no better as the German showed a time a three-tenths slower time than Hamilton.
"The day was pretty good, but it was a tricky one because it was so windy out there", said the Briton, who was gifted a win in Baku two weeks ago when Bottas had a puncture in the closing laps while leading.
Kubica had replaced Russian rookie Sergey Sirotkin who returned to finish 20th in the second session.
The Spaniard, who is yet to qualify in the top 10 this year, added: "Overall I think we are little bit more competitive than any other Friday, so hopefully Q3 tomorrow for the first time is a real possibility".
Vettel's teammate Kimi Raikkonen suffered a power unit problem.
Nico Hulkenberg of Renault failed to make it past the first qualifying session because of an apparent fuel pressure issue.
There was some disquiet with the rear-view mirrors Ferrari mounted on the halos, with motorsport governing body FIA looking into a possible breach of regulations.
His team-mate Brendon Hartley was not able to qualify as the team was unable to fix his auto in time following his crash in FP3.
Hartley touched the grass on the entry to the fast right-hand Turn 9 and flew sideways across the gravel into the barriers on the outside. The rear end fell apart as the auto was being hoisted by a crane.
Stroll almost hit the tire barriers after going off the track with about a half-hour left in the first session.
Race organizers said additional security was implemented after several cars were broken into at a closed parking lot for the media at the track.
The virtual safety auto was deployed briefly, with Ricciardo's vehicle running across the gravel and into the barriers, with several others also spinning.