On July 2, 1996, a 550 km wide alien mothership enters Earth's orbit and deploys 36 saucer-shaped "destroyer" spacecraft, each 15 miles (24 km) wide. As they take position over some of Earth's major cities, David Levinson (Jeff Goldblum), an MIT graduate working for a cable company in New York City, discovers hidden transmissions in Earth's satellites which he realizes is a timer counting down to a coordinated attack by the aliens. With the support of his estranged wife Constance Spano (Margaret Colin), the White House Communications Director, he and his father Julius (Judd Hirsch) gain entrance into the Oval Office to notify President Thomas J. Whitmore (Bill Pullman) about the attack. Whitmore orders large-scale evacuations of the targeted cities, but the aliens attack with advanced directed-energy weapons before these can be carried out. Whitmore, portions of his staff, and the Levinsons narrowly escape aboard Air Force One as Washington, D.C., Los Angeles, New York and other major cities around the world are destroyed.
On July 3, the Black Knights, a squadron of Marine Corps F/A-18 Hornets, participate in an assault on a destroyer near the ruins of Los Angeles. Their weapons fail to penetrate the craft's force field. Dozens of "attacker" ships are launched by the aliens in defense, and a one-sided dogfight ensues in which nearly all the Hornets are destroyed. Afterwards, many American military installations, including NORAD, are destroyed, killing the Vice President and most of the Cabinet who had been hiding there. Captain Steven Hiller (Will Smith) is the only pilot to survive the Los Angeles assault by luring a single attacker to the Grand Canyon and causing their aircraft to crash into the desert. He subdues the injured alien and is rescued by Russell Casse (Randy Quaid), who is traveling across the desert with a group of refugees. They take the alien to nearby Area 51, where Whitmore and his remaining staff have also landed. Area 51 conceals a top-secret facility housing a repaired attacker and three alien bodies recovered from Roswell in 1947.
When scientist Dr. Brackish Okun (Brent Spiner) attempts to autopsy the alien, he regains consciousness and attempts to escape. When questioned by Whitmore, the alien attempts a psychic attack against him, but is killed by Whitmore's security detail. Whitmore then mentions that while he was being attacked, he saw the alien's thoughts; what his species is planning to do. They are like locusts; their entire species travel from planet to planet, destroying all life and harvesting the natural resources. Whitmore reluctantly orders a nuclear attack on the destroyers; a B-2 Spirit fires a nuclear missile at one of the destroyers above Houston, but the missile fails to penetrate the force field of the destroyer and the remaining strikes are aborted.
On July 4, Levinson devises a plan to use the repaired attacker to introduce a computer virus and plant a nuclear missile on board the mothership, theorizing that this will disrupt the force fields of the destroyers. Hiller volunteers to pilot the attacker, with Levinson accompanying him. With not enough military pilots to man all available aircraft, volunteers including Whitmore and Casse are enlisted for the counterstrike.
With the successful implantation of the virus, Whitmore leads the attack against an alien destroyer approaching Area 51. Although the force field is deactivated and the fighters are able to inflict damage, the hull of the destroyer is too big to inflict serious damage. As a result, the fighter's supply of missiles quickly becomes exhausted. As the destroyer prepares to fire on the base, Casse has one missile left, but it jams. He decides to fly his plane directly into the alien weapon in a kamikaze attack, which kills him but destroys it. The Americans inform resistance forces around the world about how to destroy the alien ships. The nuclear device destroys the alien mothership as Hiller and Levinson escape unharmed back to Earth. The whole world then celebrates its heroes' victory as well as its true 'Independence Day'.