Lewis Hamilton took a brilliant pole position for the Azerbaijan Grand Prix ahead of Valtteri Bottas on Saturday, with Mercedes securing a convincing 1-2 as rival Ferrari lagged behind.
Bottas led qualifying and then set an even quicker time on his final lap — only for Hamilton to beat him by nearly half a second.
"There was a lot of pressure with a minute left. It was all or nothing," Hamilton said. "That was one of the most exciting laps I've had all year. I'm so pumped, that's how qualifying should be."
The British driver's 66th pole moves him one ahead of Formula One great Ayrton Senna and just two behind Michael Schumacher's all-time record of 68.
"I thought the hunger might drop off after I matched him (Senna)," Hamilton said. "But I was hungrier than ever today."
Raikkonen was more than one second behind Hamilton, qualifying third ahead of his Ferrari teammate Sebastian Vettel, the championship leader.
After his impressive pole at the Canadian GP two weeks ago, it was another commanding performance from Hamilton as he took his fifth pole in seven races this season.
"My last lap in Montreal was pretty special but I think this one topped it," the three-time F1 champion said.
After three difficult practice sessions, qualifying also proved tough — with Turns 2, 6 and 8 causing most problems. There were close calls for Bottas and Vettel while Force India's Sergio Perez shaved the barriers on the demanding street circuit.
With three minutes remaining a red flag came up, halting the session, after Daniel Ricciardo clipped the wall with the left side of his Red Bull coming out of Turn 6 — prompting an expletive from the Australian driver.
Ricciardo's teammate, Max Verstappen, qualified fifth ahead of Perez. But it was disappointing for the 19-year-old Verstappen, considering he topped both of Friday's practice sessions.
Bottas, meanwhile, was disappointed not to secure his second career pole.
"I wasn't quite comfortable with the tire temperature," said Bottas, who took pole at the Bahrain GP in April. "Just didn't get them to work as well as Lewis."
It was also a sweet moment for Hamilton's mechanics, considering how difficult Friday's practice had been.
"Yesterday we were at a bit of a loss and we had to make a lot of changes overnight," said Hamilton, who was 10th in P2. "This morning, we didn't know if those changes were going to be right or not. But the guys did excellent work."
Hamilton is 12 points behind Vettel and will be confident of closing that gap on Sunday.
At the other end of the F1 spectrum, the misery continues for struggling McLaren as Fernando Alonso and Stoffel Vandoorne were eliminated from the first part of qualifying. So were Romain Grosjean (Haas), Marcus Ericsson (Sauber) and Jolyon Palmer (Renault).
Hamilton topped Q1 ahead of Verstappen and Raikkonen. Williams driver Felipe Massa misjudged the difficult approach into Turn 8 and Carlos Sainz Jr. overshot the entry into Turn 2 — which happened to several drivers over the two days.
Hamilton topped Q2 ahead of Bottas and Vettel. The Q2 eliminated rivers were: Toro Rosso drivers Daniil Kvyat and Sainz Jr.; Kevin Magnussen (Haas); Nico Hulkenberg (Renault); and Pascal Wehrlein (Sauber).
In Q3, Bottas went close to clipping the wall on Turn 8, and Vettel took an exit road and span after a braking error.
Earlier, in an eventful P3, Bottas was fastest.
Both days, drivers were severely tested on the 6-kilometer (3.7-mile) track, which is volatile and unpredictable due to a combination of long straights, blistering track temperatures and hard-braking corners.
Just seven minutes into P3, Palmer's engine caught fire, forcing him to go off the track and ruling him out of qualifying.