The quickest lap of Hamilton, which read 1min 40.593sec, came in the final seconds of the session following a red-flagged stoppage which turned the finale into a 3min 30sec showdown.
The pole is the Britain's 66th in Formula 1, putting him just two shy of the all-time record by Michael Schumacher.
Vettel entered the session on the back foot, after Ferrari reverted to an older engine as a precaution between final practice and qualifying having discovered a hydraulic leak.
"It's been hard with the tires to switch them on, it's been a struggle", Räikkönen said, who was more than a second behind Hamilton's pole time.
Hamilton had dominated Q1 with a lap of 1m 41.983s which left Verstappen breathless on 1m 42.544s as Raikkonen, Ricciardo, Vettel (with a new "old" engine in his Ferrari after his vehicle developed a water leak in FP3) and Bottas followed. "On the first lap [in Q3] I had the time, but I made a mistake in the last corner".
Max Verstappen came close to relegating Vettel a further place, missing out by just 0.038s, but suggestions Red Bull could be in the fight for pole after strong practice form fell flat as Mercedes ran away at the front.
Rural South Korean County Prepares For Role As 2018 Winter Olympics Host
According to the Korea Herald , he will discuss the possibility of North Korea hosting competitions at the Masikryong ski resort. About 40 percent said they were interested in the Olympics, a four percent increase, with nine percent saying they would attend.
"That's how qualifying should be", Hamilton added.
"We would have loved to have had more laps this morning".
Fernando Alonso will start Sunday's race from the back of the grid following a series of changes to his Honda engine.
This year sees our second visit to the Baku City Circuit, and it's a track that divides opinions. It was looking good before the late red flag, but Lewis produced a great lap and mine just wasn't good enough.
"The result is okay, but obviously I am not entirely happy".
Force India pair Sergio Perez and Esteban Ocon finished sixth and seventh quickest respectively while Williams' Lance Stroll continued his improvement following a points finish in Canada last time out, as he qualified eighth fastest, narrowly edging out team-mate Felipe Massa.
"I'm no fan of excuses, I could have done a bit better but probably P3 was the maximum". "It's not about being greedy, it's about having that right balance; it's basically like a see-saw and I had a ideal balance between aggressiveness and taking too much out".