Set in the distant future, humanity has a tense non-aggression truce with the bugs of planet Klendathu, and its surrounding systems. Skilled pilot Carmen Ibanez and the subtly psychic Carl Jenkins enlist in the military to become Citizens of Earth, allowing them extra rights that are due to Citizens. Johnny Rico, Carmen's boyfriend, wants to join Carmen in Flight School, but lacks the grades. He also lacks the psychic ability to join Carl in the Intelligence Division, and so, despite his parents' wishes, enlists in the mobile infantry. Johnny shows great promise as the leader of his squad, especially after his classmate "Dizzy" Flores joins his unit. Johnny soon learns that Carmen has found a new love the Pilot Academy and wishes to end their relationship, though still continue to be friends.
Johnny undergoes a training exercise with his squad using live ammo, and one of the men under his command is killed. Johnny is flogged in public and offered a chance to leave the mobile infantry. He nearly takes the chance until a meteor, sent ostensibly by the bug planet Klendathu, destroys his homeland of Buenos Aires, killing millions including Johnny's parents. Earth declares open war on Klendathu and Johnny is able to convince his superior officers to allow him to stay in the Mobile Infantry.
Earth launches a full-scale assault of the bug homeworld, but drastically underestimates their fighting strength, and the primary assault becomes a complete failure, the human forces being either routed or slaughtered. Part of this is due to the bugs' ability to launch powerful anti-ship rockets, generated by some of the larger creatures of their species, which decimates the human fleet before they even touchdown. An error in the casualty list tells Carmen Ibanez that Johnny has been Killed In Action, but this is quickly revealed to be a fallacy as Dizzy and Ace, a friend of Johnny's from training, taunt Johnny while he's in a regeneration chamber. Dizzy even kisses the side of the container after Ace has left. The ultimate result of this failed battle is that humanity realizes that there must be some kind of "thinking bug," as their enemies displayed tactics. Johnny's old pro-military high school teacher, Lieutenant Jean Rasczak, has started up an infantry division called the "Roughnecks," which Johnny, Dizzy and Ace quickly join. The surrounding planets of the Klendathu system are assaulted by humanity's new, more cautious orbital bombardment approach, and the Roughnecks are sent to the planet Tango Urilla to wipe up Arachnid forces. Johnny is able to lead his squad to victory against an arachnid tank unit, leading humanity to victory and a promotion to Corporal for Johnny. Lt. Rasczak declares a night of night of rest and relaxation during which Johnny and Dizzy consummate their new relationship.
Days later, Johnny and his squad investigate an outpost that has suddenly gone silent. The garrison has been slaughtered, several of the higher ranking officers having had their brains sucked out of their skulls. The bugs attack the outpost, killing several members of the squad including Lt. Rasczak. Johnny requests an evacuation ship, which arrives and happens to be commandeered by Carmen Ibanez. Before she can board, however, Dizzy is killed by one of the surviving bugs. The two friends reunite with Carl, who reveals that the Roughnecks were used as bait to learn more about the bugs' tactics. Carmen and Johnny are both enraged, but the intelligence has uncovered the fact that there must be a "thinking class" who are leading the bugs. Johnny is given a promotion to Lieutenant so he can lead the Roughnecks in a surgical strike against the brain bug.
The Roughnecks explore Planet P as the vessel Roger Young is shot down by bug ground-to-air attacks, Ibanez and her boyfriend Zander crash into a bug's nest. Zander has his brain sucked out of his skull. Rico hears about the ship's crash and takes his squad to investigate the site and try to find any survivors. Johnny is guided by strange, psychic premonitions to where Carmen is, but arrives to late to save Zander. Carmen hacks off the brain bug's proboscis with a knife and flees with Johnny as one of his injured squad members sacrifices himself using a hand held nuke as his squad makes their escape.
Johnny, Ace and Carmen flee to the surface, only to find that Johnny's old drill sergeant Zim, leading another squad of mobile infantry, has captured the brain bug. Carl postulates that they'll be able to use the brain bug to find out how the arachnids think and turn the tide of the war in favor the humans. The movie ends with an ironic propaganda film talking about humanity's inevitable victory over the bug forces.