U.S. President James Sawyer (Jamie Foxx) is receiving controversy over a proposed peace treaty between allied countries to remove military forces from the Middle East.
John Cale (Channing Tatum) is a U.S. Capitol Police officer assigned to Speaker of the House Eli Raphelson (Richard Jenkins) after Cale saved Raphelson's nephew's life during a tour in Afghanistan. Cale is 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, 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 respect for authority and follow-through. After lying to Emily about the outcome of the interview, she and Cale join a tour of the White House.
Meanwhile, a bomb is detonated at the center of the U.S. Capitol building. Raphelson, who was in the Capitol, remains unharmed and is taken to an underground command center with Finnerty while Vice President 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, disguised mercenaries led by Emil Stenz (Jason Clarke), start killing off most of the Secret Service and take the tour group hostage, but Cale manages to take a gun and escapes a mercenary named Killick (Kevin Rankin) to go find his daughter. Following protocol, retiring Head of the Presidential Detail Martin Walker (James Woods) escorts Sawyer and his detail to the Presidential Emergency Operations Center. Once Sawyer gains access, Walker kills Sawyer's detail, revealing himself to be the real leader and his desire for revenge over his son who was killed in a botched black ops mission. Cale, who fails to find Emily, kills a mercenary and takes his gun and radio. Overhearing the radio, Cale locates and rescues President Sawyer.
Walker and Stenz bring in Skip Tyler (Jimmi Simpson) to hack into the defense system, but they still require Sawyer to activate the nuclear football. They locate the remaining presidential line of succession, kill the Secretary of Defense, and place rest of the line of succession with the hostages. Emily, while hiding, records a video of the mercenaries and uploads it to YouTube before eventually being captured. Walker demands $400 million from the Federal Reserve as ransom for the hostages. Cale and Sawyer manage to reach out to command which tells Cale to get Sawyer out through underground tunnels. At the command center, Finnerty uses Emily's video to discover the mercenaries' identities, discovering that they used to work for various government agencies and radical political groups. They also discover that Walker has an inoperable tumor, suggesting his involvement to be a suicide mission and that the attack is not for ransom. Cale and Sawyer find the tunnel gate rigged with an explosive and are forced to escape with a presidential limousine. After giving chase with Stenz on the White House lawn, Cale and Sawyer are 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 Javelin surface-to-air missiles, Cale tries but fails to stop the mercenaries from shooting down the helicopters. 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, knowing that she is Cale's daughter, takes her to Walker in the Oval Office. Meanwhile, Tyler finishes the upload to NORAD and launches a missile at Air Force One, killing everyone on board including Hammond. Raphelson is then sworn in as acting President and reluctantly orders an air strike on the White House, which Cale is informed of.
Walker tells Cale over the White House intercom to surrender Sawyer or he will kill Emily. Sawyer ultimately surrenders himself to save Emily, knowing Cale could still save them if he was free. However, he refuses to activate the football. When Walker threatens to kill Emily again, the alarms and sprinklers are set off by Cale setting various rooms on fire. Tyler tries to escape by deactivating the bomb on the tunnel gate, but discovers that it has been tampered with so it goes off rather than disarm when he leaves. Killick finds Cale and tries to kill him, but is ambushed by Donnie the tour guide, bludgeoning Killick to death with a bronze clock. After freeing the hostages and entrusting Donnie to get them out safely, Cale is confronted by Stenz, who Cale kills with a grenade belt. Sawyer attacks a distracted Walker, who ultimately gains the upper hand and uses him to activate the football before apparently shooting him dead. Using updated launch codes received by an anonymous source, Walker targets various cities in Iran, but before he initiates the launch, Cale crashes into the office in a presidential escort vehicle and kills Walker with a minigun at the last second. 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 they eventually do. Sawyer is revealed to be alive, the bullet having hit a pocket watch his wife (Garcelle Beauvais) had given him, originally given to Abraham Lincoln by his wife, Mary Todd. Finnerty calls them to reveal that the mercenaries were not called in by Walker and that there is another mastermind behind the attack. Cale realizes who it is and asks Sawyer for his help in exposing the traitor.
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 reveals Raphelson had orchestrated the attack because of Raphelson's disagreement with Sawyer's treaty and proves it by having Finnerty call the call-back number on the pager. Sawyer then reveals himself and has Raphelson taken into custody, treating his taking of the Presidency as a coup d'état. Sawyer officially employs Cale into the Secret Service and takes him and Emily on a personalized aerial tour of Washington, D.C. on his way to the hospital. As a result of the events, the leaders of Russia, China, Israel, France and Iran agree to Sawyer's peace treaty, allowing him to bring the peace he wanted.