Sebastian Vettel will start the Bahrain Grand Prix from pole position as Ferrari completed a front row lockout in a hotly contested qualifying session.
Vettel made mistake on his first run in Q3 by running wide at the final corner but he quickly made amends on the final run to claim pole position with a 1:29.958s effort.
Raikkonen had held provisional pole after the first run but was left to settle for second having stopped the clock 0.143s slower than his team-mate.
“I'm really happy that I got the second run and got it clean. I just had to stay way from that kerb (referring to his earlier error),” said Vettel.
“The car has been excellent all weekend so far.”
Ferrari appeared to have an advantage on Mercedes as Valtteri Bottas could only manage third.
The Finn pipped Lewis Hamilton, who entered qualifying with a five-place grid penalty, after undergoing a gearbox change.
As a result, Hamilton will start the race from ninth but will start on the soft tyres, instead of the faster super soft, after using the compound in Q2.
Daniel Ricciardo set the fifth fastest time but will join Bottas on the second row.
Red Bull were able to close the gap to Ferrari and Mercedes on pace in what proved to be an encouraging performance from the Australian.
The same could not be said for the sister Red Bull of Max Verstappen, who will start from 15th after crashing out in Q1.
The Dutchman, who occupied fourth on the times in Q1, lost control while navigating through Turn 2, which resulted in the RB14 sliding into the barriers, damaging the front left wheel and wing.
Verstappen's incident brought out the red flags, the session restarted with four minutes on the clock.
However, the star of qualifying was Pierre Gasly who claimed fifth in the Toro Rosso Honda.
The Frenchman has impressed throughout practice as Toro Rosso overshadowed McLaren, which ditched Honda engines for Renault power units this year.
Haas F1's Kevin Magnussen was sixth in front of Renault's Nico Hulkenberg and Force India's Esteban Ocon.
Carlos Sainz Jnr rounded out the top 10 for Renault.
A late effort in Q2 saw Brendon Hartley (Toro Rosso) leap into 11th demoting Sergio Perez to 12th, while McLaren struggled for speed as Fernando Alonso ended up 13th, with Stoffel Vandoorne in 14th position.
Haas F1's Romain Grosjean was unable to build on his impressive showing at Albert Park, qualifying 16th after narrowly missing out on a place in the second segment of qualifying.
Williams endured a disastrous session as both cars failed to progress from Q1 with Sergey Sirotkin 18th ahead of his more experienced team-mate Lance Stroll in 20th position.
The Grove-based squad sandwiched the Sauber of Charles Leclerc, being the other Sauber of 17th-placed Marcus Ericsson.
The Bahrain Grand Prix is scheduled to begin at 0110 AEST on Monday.
Result: Formula 1 Bahrain Grand Prix Qualifying
|0.262s (five-place grid penalty)