Divorced longshoreman Ray Ferrier works at a dock in Brooklyn, New York, and is estranged from his children: 10-year-old daughter Rachel, and teenage son Robbie. Ray’s ex-wife, Mary Ann, drops them off at his house in Bayonne, New Jersey, on her way to visit her parents in Boston.
Later, a strange storm occurs during which lightning strikes multiple times into the middle of a local intersection, disrupting all electricity. Ray joins the crowd at the scene of the impacts, where a massive “tripod” war machine emerges from the ground and uses powerful energy weapons to destroy the area, disintegrating most of the witnesses into a grey dust. Ray collects his children, steals a van that had just been repaired, and drives to Mary Ann’s empty home in suburban New Jersey to take refuge. That night, they take shelter in the basement, but they soon hear a strange roaring noise followed by an explosion, which destroys the house. The next morning, Ray discovers that a Boeing 747 had crashed into the neighborhood. A wandering news team scavenging food from the wreckage explains to him that there are multiple tripods that have attacked major cities around the world. The tripods have force shields to protect them from human weapons, and the tripods’ pilots traveled to Earth within the lightning storms as a way to enter their machines, which are assumed to have been buried underground for millions of years.
Ray decides to drive the kids to Boston to be with their mother, but a desperate mob swarm their vehicle and they are forced to abandon it. They eventually board a ferry to cross the Hudson River only to be surrounded by several tripods, who begin massacring and abducting many of the refugees, but Ray’s family manages to escape. They then witness U.S. Marines engaging in a futile battle with some tripods; Ray tries to stop Robbie from joining the fight, but is reluctantly forced to release him so that he can take Rachel to safety. Ray and Rachel flee as the machines annihilate the soldiers, and are offered shelter in a farmhouse basement by a deranged man named Harlan Ogilvy.
The three remain undetected for several days, even as a probe and a group of tripod aliens explore the basement. They soon discover that the aliens are cultivating a red-colored vegetation across the landscape that is quickly spreading; the group deduces the aliens are modifying Earth to make it more like their home planet. The next morning, Ogilvy suffers a mental breakdown upon witnessing the tripods harvesting human blood and tissue to fertilize the alien vegetation. Fearing that Ogilvy’s mad shouting will alert the aliens, Ray reluctantly kills him. A second tripod probe catches the Ferriers sleeping; Rachel flees and is abducted by a nearby tripod, and Ray joins her after picking up a belt of grenades. Ray uses the grenades to destroy the tripod from within, freeing all the abductees.
Ray and Rachel arrive in Boston, where they find the alien vegetation withering and the tripods inexplicably collapsing. When an active tripod appears, Ray notices birds landing on it, indicating its shields are offline. Ray alerts the soldiers escorting the fleeing crowd, who shoot it down with anti-tank missiles. As the soldiers advance on the downed tripod, a hatch opens and a sickly alien struggles halfway out before dying. Ray and Rachel finally reach Mary Ann’s parents’ house, where they are reunited with Mary Ann and Robbie.
A closing narration explains that the aliens’ immune systems could not handle the countless billions of microbes that inhabit the Earth, and that humanity has “earned” the right to the planet by virtue of naturally coexisting with the rest of its biosphere.