In the 31st century, three members of the Fatal Five—Tharok, Persuader and Mano—attack the headquarters of the Legion of Super-Heroes, with the aim of capturing their time travel device. Star Boy, Saturn Girl and Brainiac 5, the only Legionnaires present, try to keep them back but fail. Just as the villains activate the device, Star Boy leaps at them and is taken along on their ride back into the 21st century. When the time machine arrives, Star Boy triggers a boobytrap Brainiac 5 has programmed into the device's computer, which traps the villains in a stasis field. Star Boy comes down in Gotham City, while the time machine ends up in Metropolis. Star Boy finds to his horror that his only supply of a mind-stabilizing drug he needs regularly has been destroyed by his rough landing. During his search for a replacement (which does not exist in this era), his increasingly erratic behavior gets him arrested by Batman and interred in Arkham. The stasis-locked time machine is picked up by Superman and brought to the Justice League's headquarters for analysis.
Ten months later, Jessica Cruz is struggling with the trauma of her near-death by a murderer who killed her friends after they had stumbled upon him burying two bodies three years ago, leaving her afraid to leave her apartment; adding to her anxiety is that a Green Lantern ring chose her, and that Wonder Woman keeps trying to recruit her into the Justice League. In Gotham, Miss Martian is trying to prove herself to Batman for membership in the League, but her inexperience works against her good intentions. While trying to unlock the secret of the strange sphere, Mister Terrific brings down the stasis field, freeing its occupants. Superman and Mister Terrific fight them, but Superman is wounded by Persuader's axe, and the villains escape. In Gotham, Star Boy's memory is jogged by a news report of that fight, and he breaks out of Arkham. The Leaguers compare notes about these unknown assailants and discover they are time travelers, and from one of Star Boy's rantings Batman deduces that they are after Jessica. When the three villains attack Jessica, Star Boy comes to her rescue, followed by Superman, Batman, Wonder Woman, Mister Terrific and Miss Martian, who force them into flight after a hard struggle. In the aftermath, Star Boy and Jessica form a close friendship.
To find out more about their guest from the future, Batman instructs Miss Martian to telepathically link their and Jessica's minds with Star Boy's memories, thus learning about the Legion. They witness a battle between the Legion—Chameleon, Dawnstar, Tyroc, Mon-El, Shadow Lass, and, later, Brainiac 5, Saturn Girl, and Star Boy—and the Fatal Five, which ended with the capture of Emerald Empress (Mano's lover) and Validus. Upon their awakening, the League receives an ultimatum from Mano: Surrender Jessica, or all American cities will be destroyed by bombs created by Tharok. The first bombings start in Metropolis, forcing the Justice League to move out. Jessica, left behind with Star Boy in the Watchtower, is contacted by Tharok through her ring, forcing her to surrender herself to the Five and enable them entry to the Green Lantern Corps science cells where Emerald Empress and Validus are held. Despite defense by the Corps, the Empress and Validus are freed, and when Jessica fights back, Persuader cleaves her ring in two. Afterwards, Emerald Empress has her Emerald Eye steal all the energy of the Central Power Battery, and the Five return to Earth to recover the time machine.
In the meantime, Star Boy discovers Jessica's absence and informs the League. The heroes proceed to the time machine's location, a secret military base, where the Five force them into battle. Emerald Empress subdues the League and then initiates her master plan to use the Lantern's power to destroy Earth's sun, wipe out humanity, and thus prevent the formation of the Legion in their time. In the prison, Jessica recovers her faith and determination, and by reciting her oath she reassembles her power ring. She returns to Earth and prevents the Five from escaping back to their own era by bringing the whole base down on them, killing them in the process.
Superman, Jessica and Star Boy then race after the Eye, but are too late to prevent it from plunging into the sun. As the star cracks apart, Star Boy sacrifices himself by lowering himself into the sun's core and using his powers to reverse the fractioning. In the final scene, as the Leaguers commemorate Star Boy's heroism, they are joined by the Legion, who have come from the future to honor their fallen comrade. Batman also grants Miss Martian admission into the League for her bravery.