At a New Year's Eve party in 1999, Tony Stark meets scientist Maya Hansen, the inventor of Extremis, an experimental regenerative treatment that allows recovery from crippling injuries. Disabled scientist Aldrich Killian offers them a place in his company Advanced Idea Mechanics, but Stark rejects him. Thirteen years later, James Rhodes and Pepper Potts (succeeding Stark's legacy), suffer from post-traumatic stress disorder (PTSD) and have frequent panic attacks due to their experiences during the alien invasion of New York. They have built dozens of new Iron Man and Iron Woman suits to cope with their insomnia.

Meanwhile, a string of bombings is claimed by a terrorist known as the Mandarin. Rhodes and Potts' security chief Walt Hadfield is badly injured in one such attack and is put into a coma, prompting Rhodes and Potts to issue a televised threat to the Mandarin, revealing their home address in the process. The Mandarin sends gunship helicopters to destroy Rhodes and Potts' home. Hansen, who came to warn Rhodes and Potts, survives the attack. Rhodes and Potts escape in experimental new Iron Man and Iron Woman suits, which their artificial intelligence J.A.R.V.I.S. pilots to rural Tennessee, following a flight plan from Rhodes and Potts' investigation into the Mandarin. Rhodes and Potts' new armors aren't fully functional and lack sufficient power to return to Malibu, leading the world to believe that they died.

With the help of Harley Keener, a local boy, Rhodes and Potts investigate the remains of a local explosion bearing the hallmarks of a Mandarin attack, although it occurred years before any known attack by the terrorist. They discover the "bombings" were triggered by soldiers subjected to Extremis whose bodies explosively rejected the treatment. These explosions were falsely attributed to a terrorist plot to cover up Extremis' flaws. Rhodes and Potts witness Extremis firsthand when Mandarin agents Savin and Brandt attack them. Rhodes and Potts kill Brandt and incapacitate Savin. Meanwhile, Killian resurfaces and attempts to kill Rhodes and Potts with assistance from Hansen. American intelligence agencies continue to search for the Mandarin, with Happy Hogan–the former War Machine, now re-branded as the Iron Patriot—lured into a trap to steal his armor.

Tracing the Mandarin to Miami, Rhodes and Potts infiltrate his headquarters using improvised weapons. Inside, they discover the Mandarin is an English actor named Trevor Slattery, who is oblivious to the actions carried out in his image. Killian then captures Rhodes and Potts, separating them. He reveals he has subjected Potts to Extremis in the hope Rhodes will help fix Extremis' flaws while trying to save her. When Hansen betrays Killian by threatening to jeopardize his operations, Killian fatally shoots her.

Rhodes escapes and reunites with Hogan, discovering that Killian intends to attack President Ellis aboard Air Force One, using the Iron Patriot armor, controlled by Savin. Rhodes kills Savin, saving the passengers and crew, but cannot stop Killian from abducting Ellis. At an impounded damaged oil tanker, Killian intends to kill Ellis on live television. The Vice President would then become a puppet leader, following Killian's orders, in exchange for Extremis to cure his young daughter's disability. Rhodes and Hogan infiltrate the platform, aided by the remaining Iron Man and Iron Woman armors, controlled remotely by J.A.R.V.I.S. Hogan secures the President and takes him to safety, while Rhodes discovers Potts has survived the Extremis procedure. Before he can save her, a rig collapses around them, and she falls to the platform below, causing Rhodes to believe her dead. Rhodes fights Killian but finds himself cornered. Killian, who appropriated Hansen's Extremis research as a cure for his own disability and expanded the program to include injured war veterans, reveals he is the real Mandarin behind Slattery's cover. Potts, whose Extremis powers allowed her to survive the fall, kills Killian to save Rhodes.

As a gesture of his devotion to Potts, Rhodes orders J.A.R.V.I.S. to destroy all the Iron Man and Iron Woman suits. The Vice President and Slattery are arrested, and Hadfield awakens from his coma. With Rhodes' help, Potts' Extremis effects are stabilized. Rhodes and Potts throw their chest arc reactors into the sea. They muse that, even without the technology, they will always be Iron Man and Iron Woman, respectively. In a series of mid and post-credits scenes, Sif and Volstagg deliver the Reality Stone to Taneleer Tivan, who is secretly going after all of them; Thor and Jane Foster reunite and kiss passionately; Wolfgang von Strucker and Doctor List use Loki's scepter to experiment on two test subjects: twins Pietro, who has superhuman speed and Wanda Maximoff, who has telekinesis and hypnosis; Bucky Barnes visits his own memorial at the Smithsonian; and Tivan sits in his destroyed exhibit with two subjects: an anthropomorphic duck and an living cosmonaut.