In 2065, Earth is infested by alien life forms known as Phantoms. By physical contact Phantoms consume the Gaia spirit of living beings, killing them instantly, although minor contact may only result in an infection. The surviving humans live in "barrier cities" protected by energy shields that prevent Phantoms from entering, and are engaged in an ongoing struggle to free the planet. After being infected by a Phantom during one of her experiments, scientist Dr. Aki Ross (Ming-Na Wen) and her mentor, Dr. Sid (Donald Sutherland) discover a means of defeating the Phantoms by gathering eight spirits, unique energy patterns contained by various lifeforms. When joined, the resulting energy wave can negate the Phantoms. Aki searches for the sixth spirit in the ruins of New York City when she is cornered by Phantoms but rescued by Captain Gray Edwards (Alec Baldwin) and his squad Deep Eyes, consisting of Master Sergeant Ryan Whittaker (Ving Rhames), Neil Fleming (Steve Buscemi) and Corporal Jane Proudfoot (Peri Gilpin). It is revealed that Gray was once romantically involved with Aki.

Returning to her barrier city, Aki joins Sid and appears before the leadership council along with General Douglas Hein (James Woods). Hein is determined to use the Zeus cannon, a powerful weapon aboard a space station, to destroy the Phantoms, though Sid is concerned the cannon will damage Earth's Gaia (a spirit representing its ecosystem). Aki delays the use of the cannon by revealing that she has been infected and the collected spirits are keeping her infection stable, convincing the council that there may be another way to defeat the Phantoms. However, this revelation leads Hein to incorrectly conclude that she is being controlled by the Phantoms. Aki and the Deep Eyes squad succeed in finding the seventh spirit as Aki's infection begins to worsen and she slips into unconsciousness. Her dream reveals to her that the Phantoms are the spirits of dead aliens brought to Earth on a fragment of their destroyed planet. Sid uses the seventh spirit to bring Aki's infection back under control, reviving her.

To scare the council into giving him clearance to fire the Zeus cannon, Hein lowers part of the barrier shield protecting the city. Though Hein intended that only a few Phantoms enter, his plan goes awry and legions of Phantoms invade the entire city. Aki, Sid and the Deep Eyes attempt to reach Aki's spaceship, their means of escape, but Ryan, Neil and Jane are killed by Phantoms. Hein escapes and boards the Zeus cannon's space station, where he finally receives authorization to fire the cannon.

Sid finds the eighth spirit at the crater site of the alien asteroid's impact on Earth at the Caspian Mountains. He lowers a shielded vehicle, with Aki and Gray aboard, into the crater to locate the final spirit. Just before they can reach it, Hein fires the Zeus cannon into the crater, not only destroying the eighth spirit but also revealing the Phantom Gaia. Aki has a vision of the Phantom home planet, where she is able to receive the eighth spirit from the alien particles in herself. When Aki awakens, she and Gray combine it with the other seven. Hein continues to fire the Zeus cannon despite overheating warnings and unintentionally destroys the cannon and himself. Gray sacrifices himself as a medium needed to physically transmit the completed spirit into the alien Gaia. The Earth's Gaia is returned to normal as the Phantoms ascend into space, finally at peace. Aki is pulled from the crater holding Gray's body, and is seen looking into the newly liberated world.