U.S. President James Sawyer (Jamie Foxx) makes a controversial proposal to remove military forces from the Middle East. Divorced veteran John Cale (Channing Tatum) works as a Capitol Police officer assigned to Speaker of the House Eli Raphelson (Richard Jenkins), whose nephew he saved while serving in Afghanistan. Cale hopes to impress his daughter Emily (Joey King) by interviewing for the Secret Service Presidential Detail, getting tickets for them to tour the White House. His interviewer, Deputy Special Agent-in-Charge Carol Finnerty (Maggie Gyllenhaal), a college acquaintance, deems him unqualified for the job.
Meanwhile, a bomb is detonated in the United States Capitol, collapsing the rotunda and sending Washington, D.C. into lockdown. Finnerty escorts Raphelson to an underground command center in the Pentagon, while Vice President Alvin Hammond (Michael Murphy) is taken aboard Air Force One. A team of mercenaries led by ex-Delta Force operative Emil Stenz (Jason Clarke) infiltrate the White House disguised as video technicians and overwhelm the Secret Service, seizing the building. The tour group is taken hostage in the Blue Room by white nationalist Carl Killick (Kevin Rankin), but Cale escapes to search for Emily, separated during the tour. Retiring Head of the Presidential Detail Special Agent-in-Charge Martin Walker (James Woods) brings Sawyer to the PEOC beneath the Library. Inside, Walker kills Sawyer’s detail, revealing himself as the leader of the attack, apparently seeking vengeance against Sawyer for his Marine son, who was killed in a botched mission in Iran the year prior. Cale kills a mercenary, taking his weapon and radio, and rescues Sawyer after overhearing Walker.
Walker brings in ex-NSA analyst Skip Tyler (Jimmi Simpson) to hack the PEOC’s defense system, but requires Sawyer to activate the nuclear football. Killick catches Emily filming the intruders on her phone and takes her hostage. Cale and Sawyer contact the command structure via scrambler in the residence, whereas Finnerty is using Emily’s YouTube video to discover the mercenaries’ identities. Cale and Sawyer try to escape via a secret tunnel but find the exit rigged with explosives. They escape in the presidential limo but are chased by Stenz and fall into the White House pool. With Sawyer and Cale presumed dead in an explosion in the cabana, the Twenty-fifth Amendment to the United States Constitution is invoked; Hammond is sworn in as president. Cale and Sawyer, still alive, learn Hammond has ordered an aerial incursion to re-acquire the White House, but the mercenaries shoot down the helicopters. Learning Emily’s identity from the video, Stenz takes her to Walker in the Oval Office. Hacking into NORAD, Tyler launches a missile at Air Force One from Piketon, Ohio, killing Hammond and everyone on board. Raphelson is sworn in as president and orders an air strike on the White House.
Sawyer surrenders himself to save Emily. Walker, blaming Iran for his son’s death, demands Sawyer use the football to launch nuclear missiles against various Iranian cities. Sawyer refuses, while Cale sets fire to several rooms as a diversion. Tyler inadvertently triggers the tunnel explosives and is vaporized. Killing most of the mercenaries and freeing the hostages, Cale blows Stenz up with a grenade belt. Sawyer attacks Walker, but in the fight Walker uses Sawyer’s handprint to activate the football and shoots Sawyer, much to Emily’s fury. Before Walker can finally launch the missiles, Cale crashes a reinforced Chevrolet Suburban into the Oval Office and kills him with the car’s rotary cannon. Emily runs outside and waves off the incoming fighter planes with a presidential flag, calling off the air strike. Sawyer survives thanks to a pocket watch that stopped Walker’s bullet.
With Finnerty’s help Cale realizes that Raphelson was Walker’s accomplice, having acted at the behest of the corrupt military–industrial complex. Believing Sawyer dead and that Cale has no proof, Raphelson is tricked into confessing and arrested for treason. Sawyer names Cale his new special agent and takes him and Emily on an aerial tour of DC on Marine One, aboard which he receives word that France, Russia, China, Israel and Iran have agreed to his peace deal after learning of the events at the White House, calling for an end to all wars.