Tony Stark recalls a New Years Eve party in 1999 with scientist Maya Hansen, inventor of Extremis—an experimental regenerative treatment intended to allow recovery from crippling injuries. Disabled scientist Aldrich Killian offers them a place in his company Advanced Idea Mechanics, but Stark rejects the offer, humiliating Killian.
Years later, Stark's experiences during the alien invasion of New York are giving him panic attacks. Restless, he has built several dozen Iron Man suits, creating friction with his girlfriend Pepper Potts. Meanwhile, a string of bombings by a terrorist known only as the Mandarin has left intelligence agencies bewildered by a lack of forensic evidence. When Stark Industries security chief Happy Hogan is badly injured in one such attack, Stark overcomes his stupor and issues a televised threat to the Mandarin, who responds by destroying Stark's home with helicopter gunships. Hansen, who came to warn Stark, survives the attack along with Potts. Stark escapes in an Iron Man suit, which his artificial intelligence JARVIS pilots to rural Tennessee, following a flight plan from Stark's investigation into the Mandarin. Stark's experimental armor lacks sufficient power to return to California, and the world believes him dead.
Teaming with Harley, a precocious 10-year-old boy, Stark investigates the remains of a local explosion bearing the hallmarks of a Mandarin attack. He discovers the "bombings" were triggered by soldiers subjected to Extremis, which at this stage of development can cause certain subjects to explosively reject it. After veterans started exploding, their deaths were used to cover up Extremis' flaws by manufacturing a terrorist plot. Stark witnesses Extremis firsthand when Mandarin agents Ellen Brandt and Eric Savin attack him.
With Harley's help, Stark traces the Mandarin to Miami and infiltrates his headquarters using improvised weapons. Inside he discovers the Mandarin is actually a British actor named Trevor Slattery, who claims he is oblivious to the actions carried out in his name. The Mandarin is actually a creation of Killian, who appropriated Hansen's Extremis research as a cure for his own disability and expanded the program to include injured war veterans. After capturing Stark, Killian reveals he is the real Mandarin; he has kidnapped Potts and subjected her to Extremis to gain Stark's aid in fixing Extremis' flaws and thereby saving Potts. Killian kills Hansen when she has a change of heart about the plan.
Killian has also manipulated American intelligence agencies regarding the Mandarin's location, luring James Rhodes—the former War Machine, now re-branded as the Iron Patriot—into a trap to steal the armor. Stark escapes and reunites with Rhodes, discovering that Killian intends to attack President Ellis aboard Air Force One. Remotely controlling his Iron Man armor, Stark saves some surviving passengers and crew but cannot stop Killian from abducting Ellis and destroying Air Force One. They trace Killian to an impounded damaged oil tanker where Killian intends to kill Ellis on live television. The vice president will become a puppet leader, following Killian's orders in exchange for Extremis to cure a little girl's disability.
On the platform, Stark goes to save Potts, and Rhodes saves the president. Stark summons his Iron Man suits, controlled remotely by JARVIS, to provide air support. Rhodes secures the president and takes him to safety, while Stark discovers Potts has survived the Extremis procedure. However, before he can save her, a rig collapses around them and she falls to her assumed death. Stark confronts Killian and traps him in an Iron Man suit that self-destructs, but fails to kill him. Potts, whose Extremis powers allowed her to survive her fall, intervenes and kills Killian.
After the battle, Stark orders JARVIS to remotely destroy each Iron Man suit as a sign of his devotion to Potts. The vice president and Slattery are arrested. With Stark's help, Potts' Extremis effects are stabilized, and Stark undergoes surgery to remove the shrapnel embedded near his heart. He pitches his obsolete chest arc reactor into the sea, musing he will always be Iron Man.
In a present day post-credits scene, Stark wakes up Dr. Bruce Banner, who fell asleep listening at the beginning of Stark's story.