On July 2, a giant alien mother ship, over 340 miles in diameter (550 km) enters orbit around Earth and deploys several dozen saucer-shaped "destroyer" spacecraft, each 15 miles (24 km) across. The destroyers take positions over many of Earth's major cities, including New York, Washington, D.C., Los Angeles, and Moscow. David Levinson (Jeff Goldblum
), an MIT graduate working on satellites for a cable company in New York City, discovers a signal hidden satellite transmissions which he believes is a timer counting down to a coordinated attack by the aliens. With the help of his ex-wife Constance Spano (Margaret Colin
), a White House staffer, David and his father Julius (Judd Hirsch
) gain entrance to the Oval Office to warn President Thomas J. Whitmore (Bill Pullman
) of the impending attack. The president immediately orders large-scale evacuations of the targeted U.S. cities, but the aliens attack with advanced directed energy weapons before the evacuations can be completed. The president, his young daughter, portions of his staff, Constance and the Levinsons narrowly escape aboard Air Force One as a destroyer lays waste to Washington D.C.
On July 3, the United States conducts a coordinated counterattack; the movie follows the Black Knights, a squadron of Marine Corps F/A-18 Hornets from El Toro Marine Corps Air Station, as they participate in an assault on the destroyer that has devastated the city of Los Angeles. Their weapons fail to penetrate the craft's force field, and it responds by releasing scores of smaller "attacker" ships which are similarly shielded and armed with high-energy torpedoes. One-sided dogfights ensue. Captain Steven Hiller (Will Smith
) manages to evade the guns of the attacker ships and lures a single attacker to the Grand Canyon. There, as his jet is about out of fuel and the attacker is about to overtake him, he deploys the landing chute for his jet and it drapes across the alien craft, temporarily disorienting the pilot. Captain Hiller ejects from his jet. The alien crashes into the top of the canyon wall and lands in the desert. Captain Hiller parachutes to a landing close by and angrily marches over to find and confront whatever life form is in the alien craft. The door to the alien fighter craft pops open and a very bizarre looking creature with tentacles appears. Captain Hiller delivers a right cross and knocks the creature out, saying "Welcome to Earth!!" He sits down and smokes a victory cigar.
As Hiller is using his parachute to drag the body of the alien across the desert, he is picked up by Russell Casse (Randy Quaid
), a crop-duster pilot who is traveling across the desert with his kids and a group of refugees in a convoy of RVs. From there they take the captured alien to Area 51, commanded by Major Mitchell (Adam Baldwin
). Area 51 also happens to be where the president and his remaining staff have landed. Area 51 conceals a top secret facility housing a repaired alien attacker ship and three dead alien bodies. In a tour, the president is told that the aliens' biochemistry is similar to our own, and they can breathe our air. They don't seem to use sound to communicate, however; the Area 51 staff believes they communicate telepathically. Attempts have been under way since the late 1960s to repair the attacker ship. The arrival of the alien mother ship activated the attacker ship's controls.
When lead scientist Dr. Brackish Okun (Brent Spiner
) removes an outer biomechanical suit from the alien Hiller captured, the living being inside is revealed. The creature regains consciousness and kills most of the examining crew, and because it has no vocal cords, it makes use of Dr. Okun's voice to communicate with President Whitmore, who is outside the glass windows of the operating room. Its first words are "Release me." President Whitmore poses a question to the alien, asking if the people of Earth and their invaders can live in peace. The creature says "No peace." When the president asks the creature what it wants them to do, it responds, "Die." It uses its telepathic powers to get into the president's head, which briefly incapacitates him. The military personnel shoot the alien through the glass, with Major Mitchell stepping through the broken glass and delivering a final head shot. Dr. Okun is left in a coma.
During the instant that President Whitmore was immobilized, he was able to read the thoughts of the alien and learned of their plan: they attack planets, kill off any indigenous life, use up the resources, then move on. "They're like locusts," he says. President Whitmore issues very clear orders to "nuke the bastards."
B-2 Spirit bombers are deployed, with the first destroyer targeted one that is hovering over a deserted Houston, TX. The weapon explodes, but proves ineffective at penetrating the craft's force field and destroys the city instead; as a result, the president orders the remaining bombers called back.
First Lady Marilyn Whitmore (Mary McDonnell
) had been on a working trip to Los Angeles and got caught up in the destroyer attack there. Captain Hiller's exotic dancer girlfriend, Jasmine Dubrow (Vivica A. Fox
), rescues Mrs. Whitmore when she comes across the wreckage of the helicopter the first lady had been attempting to escape in. Captain Hiller later finds Jasmine, her son Dylan, and the first lady camped out in the remains of El Toro MCAS and flies them in a helicopter to Area 51. A doctor tells the president that his wife has uncontrollable internal bleeding. When the President goes in to see her, he says, "The doctors say you're gonna be just fine." She smiles and responds softly, "Liar." She dies not long after that.
On July 4, President Whitmore's nerves are understandably frayed, so when Secretary of Defense Nimzicki (James Rebhorn
) criticizes his decisions and actions, President Whitmore fires him on the spot.
David Levinson suggests a plan that involves using the newly operable alien attacker to gain access to the interior of the alien mother ship in space in order to introduce a computer virus that will disable the protective shields around the destroyers and attackers. Once the computer virus takes effect, nuclear weapons could be used to destroy the mothership. Hiller volunteers to pilot the attacker, with Levinson accompanying him to upload the virus.
Before the mission, Hiller and Jasmine take a few minutes to get married, with Dylan as ringbearer and David Levinson and Connie Spano as witnesses. David and Connie reconnect during the service and hold hands.
With satellite communications knocked out, the Americans must use Morse code to coordinate an attack with the remaining forces around the world, timed to occur when the invaders' shields are set to fail. Lacking enough military pilots to fly all available aircraft, the commanders call for volunteer pilots. Those who step up include President Whitmore and Russell Casse, who both have previous combat flight experience.
Hiller and Levinson reach the mother ship and implant the virus. President Whitmore leads the American jet fighters against the alien destroyer approaching Area 51. Although the aliens now lack shields, the fighters' supply of missiles is quickly exhausted against the colossal craft and its large complement of assault ships. The underside of the alien craft opens up as its directed energy weapon prepares to fire on the base.The president fires a missile at the cannon but it connects and explodes with a protective hatch. Just as the squadron is informed that all their missiles have been fired, Russell Casse radios in saying he has one final rocket. As he launches it, his firing mechanism jams; he decides to pilot his aircraft into the alien weapon in a kamikaze attack. The explosion causes a chain reaction which annihilates the ship. Human resistance forces around the world use the same weak point to destroy the remainder of the alien ships, while the nuclear device planted by Hiller and Levinson destroys the alien mother ship soon after the duo escape. Hiller and Levinson are caught up in the aftereffects of the mother ship's explosion, but are able to return to earth unharmed, crash-landing the alien fighter in the desert close to Area 51. When they emerge from the smoke and dust to join their waiting friends, they're both smoking cigars. The film ends as the everyone watches debris from the mother ship enter the atmosphere like shooting stars.