Raikkonen overcame poleman Hamilton at the start and withstood late pressure from Max Verstappen and the Mercedes driver to finally win in his second spell with Ferrari.
It is the Finn’s first victory since the 2013 Australian Grand Prix.
Vettel’s fourth place, the German having passed Valtteri Bottas late on in his recovery drive, means Hamilton leads by 70 points with 75 on offer in the final three grands prix.
Hamilton went into the Austin race needing to outscore Vettel by eight points to clinch a fifth championship.
He erred at the start as Raikkonen muscled past on the inside into Turn 1, but half a lap later the pendulum swung in Hamilton’s favour when Vettel spun to 15th.
Vettel breezed past Daniel Ricciardo down the back straight but made a small mistake under braking for the next corner and Ricciardo cut back on the exit of the tight left-hander.
That gave Vettel the inside line for the next right-hander, but the German had a small wobble, bumped into the Red Bull and ended up facing the wrong way.
Raikkonen kept Hamilton at bay until an early virtual safety car led to Ferrari and Mercedes adopting different strategies.
With the race neutralised as marshals tended to Ricciardo’s stricken Red Bull, which had stopped on the exit of the Turn 11 hairpin, Mercedes told Hamilton to do the opposite to Raikkonen under the VSC and so he dived into the pits, committing to a two-stop strategy.
Hamilton resumed in third place, just nine seconds behind the Finn, and within three laps had taken second from teammate Bottas, who slowed down on the start-finish straight to let him by.
By lap 18 of 56, Hamilton was already on the back of Raikkonen again but the Finn somehow resisted three laps of relentless Hamilton pressure before pitting.
Vettel stayed out until lap 26, ceding places to Raikkonen and Verstappen – who had charged from 18th in a stunning first stint on softs – as he struggled with fading tyres.
Raikkonen’s task was to stay within one pitstop – roughly 20s – of Hamilton, while Vettel began to catch Bottas for fourth.
Hamilton’s 18-second lead was gradually eroded by Raikkonen and as the Mercedes’ ageing softs worsened, third-place man Verstappen and Bottas comfortably got inside Hamilton’s pitstop window.
He stopped on lap 37, which handed Raikkonen a 2.5-second lead over Verstappen, with Bottas 6.5s further back and Hamilton fourth, 12s behind the lead Ferrari and 4.1s clear of Vettel.
Armed with fresh softs, Hamilton raced onto the back of his teammate and was let through within two laps.
That put Hamilton third, 8.8s off the lead, but with Vettel stuck in fifth Hamilton only needed to pass Verstappen – 6.7s ahead with 15 laps to go – to secure the title.
He closed onto the back of Verstappen with seven laps to go, but was not able to make a pass as their battle culminated in an epic run of four corners side-by-side.
Hamilton ran wide as he finally attempted to pass Verstappen on the outside of the fast double-right near the end of the lap.
Moments later, Vettel passed Bottas at the hairpin to lose only two points to Hamilton as the title fight continues.
Behind the leaders, Renault received a late boost in its quest for fourth in the constructors’ championship as Nico Hulkenberg led home teammate Carlos Sainz for a best-of-the-rest one-two.
Esteban Ocon (Racing Point Force India), Kevin Magnussen (Haas) and Ocon’s teammate Sergio Perez completed the points finishers.
There were four retirees from the grand prix.
Long before Ricciardo ground to a halt in his Red Bull, Fernando Alonso and Romain Grosjean had their races ruined on the opening lap.
Alonso stopped in the pits after being wiped out by Lance Stroll on the entry to the esses, while Grosjean locked up and clattered into Charles Leclerc’s Sauber at the tight left-hander at the end of the back straight.
Stroll was given a drive-through penalty for spinning Alonso, while Grosjean’s incident – which sent Leclerc, who eventually retired much later, to the back of the pack – will be investigated after the race.
Grosjean faces an automatic one-race ban if the stewards award him three licence penalty points, having already picked up nine in the last 12 months.