President of the United States James Sawyer (Jamie Foxx) is generating controversy over a proposed peace treaty between the allied nations to remove military forces from the Middle East. John Cale (Channing Tatum) is a US Capitol Police officer assigned to Speaker of the House Eli Raphelson (Richard Jenkins) after he saved his nephew's life during a tour in Afghanistan. He is divorced and struggling to develop a better relationship with his daughter Emily (Joey King), who has a strong enthusiasm for politics. He hopes to impress her by getting a job with the Secret Service protecting the President, but his hopes are dashed when the interview is conducted by Carol Finnerty (Maggie Gyllenhaal), a former college acquaintance of his who believes him to be unqualified due to a lack of follow-through and respect for authority. To avoid admitting the truth to Emily, Cale takes her on a tour of the White House.
Meanwhile, a man disguised as a janitor sets off a bomb at the center of the US Capitol building. Raphelson, who was in the Capitol, remains unharmed and is taken to an underground command center with Finnerty, while Vice President of the United States Alvin Hammond (Michael Murphy) is taken aboard Air Force One. The White House is put on lockdown, separating Cale from Emily, who had left the tour group to use the restroom. Meanwhile, mercenaries led by Emil Stenz (Jason Clarke), who had disguised themselves as video technicians to get inside the White House, start killing off most of the Secret Service and take the tour group hostage, but Cale manages to take a gun and escape to go find his daughter. Retiring Head of the Presidential Detail Martin Walker (James Woods) escorts the President and his detail to the Presidential Emergency Operations Center. Once Sawyer gains access, Walker kills his detail, revealing himself to be the real leader who wants vengeance against Sawyer after a botched black ops mission resulted in the death of Walker's son. Cale, who failed to find Emily, kills a mercenary and takes his gun and radio. Overhearing the radio, Cale locates and rescues Sawyer.
Walker and Stenz bring in Skip Tyler (Jimmi Simpson) to hack into their defense system, but they still require Sawyer to activate the nuclear football. They locate the remaining chain of command and execute the Secretary of Defense before putting them with the hostages. Emily, while hiding, records a video of the mercenaries and puts in on YouTube but gets caught and captured by Carl Killick (Kevin Rankin). Cale and Sawyer manage to reach out to the command structure, who tell Cale to get the President out through underground tunnels. At the command center, Finnerty uses Emily's video to discover the identities of the mercenaries, who used to work for various government agencies. They also discover that Walker has an inoperable tumor, suggesting his involvement to be a suicide mission and that the attack is meant for more dangerous reasons. Cale and Sawyer find the tunnel gate rigged with an explosive and are forced to escape with a presidential limo. After giving chase with Stenz on the White House lawn, Cale and Sawyer get flipped into the White House pool after Cale gets distracted by Killick holding Emily at gunpoint. A gunfight erupts which results in an explosion that leaves Sawyer and Cale presumed dead. Hammond is then sworn in as acting President.
When Cale and Sawyer reveal they are still alive, they learn Hammond has ordered an aerial incursion to take back the White House. Knowing the mercenaries have Javelins, Cale tries but fails to stop them from shooting down the choppers. Cale gets into a fight with Stenz and ends up dropping his White House passes for himself and Emily while escaping. Having already learned of Emily from the video, Stenz, now knowing she is Cale's daughter, takes her to Walker in the Oval Office. Meanwhile, Tyler finally finishes the upload into NORAD and launches a missile at Air Force One, killing Hammond and everyone on board. Raphelson is then sworn in as acting President and reluctantly orders an air strike on the White House, of which Cale is informed.
Walker tells Cale over the White House intercom to surrender Sawyer or Stenz will kill Emily. Sawyer ultimately surrenders himself to save Emily, and Walker reveals his true plan: to use the football to launch the nuclear missiles against the various cities in Iran, which would result in retaliation by many countries and the start of World War III. Sawyer refuses to activate the football, but when Walker threatens to kill Emily again, the alarms and sprinklers are set off by Cale setting various rooms on fire. Tyler is killed while trying to escape by the bomb on the tunnel gate having been tampered with. After killing most of the remaining mercenaries and freeing the hostages, Cale is confronted by Stenz, who Cale blows up with a grenade belt. Sawyer attacks a distracted Walker, who ultimately gains the upper hand and uses him to activate the football before supposedly shooting him chest dead, infuriating Emily. Using updated launch codes received by an anonymous source, Walker begins targeting various cities in Iran, but before he initiates the launch, Cale crashes into the office and kills Walker with a minigun. When Emily is told of the air strike, she takes a presidential flag and waves it on the front lawn to get the fighters to call off the attack, which is what they eventually do. The news media declares Emily a hero as Sawyer is revealed to be alive as the bullet had hit a pocket watch handed down to him from Abraham Lincoln. Finnerty calls Cale to reveal that Walker didn't call in the mercenaries, and there is another mastermind behind the attack.
When Finnerty arrives at the White House with Raphelson, Cale tells them Sawyer was killed. Raphelson then orders troops to be placed back into the Middle East, which would go against Sawyer's peace treaty. Cale presses Raphelson about conspiring with Walker to orchestrate the attack and proves it by having Finnerty dial his pager number. Sawyer arrives and has Raphelson arrested. Sawyer officially employs Cale into the Secret Service and takes him and Emily on a personalized aerial tour of DC.