The film is set in the futuristic Metro City, a metropolis which floats in the sky above the polluted "Surface". Metro City's population is aided by a multitude of different robots who are dumped on the Surface when broken or disused. Toby, son of Dr. Tenma, learns that his father is going to show President Stone, the militaristic leader of the city, the Peacekeeper, a new guardian robot that he's been working on. Doctor Elefun, one of Tenma's colleagues, introduces Stone to the Blue and Red Cores, two energy spheres mined from a star fragment, that produce energy which can power robots via positive and negative energy, respectively. Stone places the Red Core in the Peacekeeper, causing it to go out of control. The Peacekeeper tries to attack the humans, but Tenma puts a barrier between them. Meanwhile, Toby has been released early from school and rewires Orrin, his family's robot, in order to attend the Ministry of Science's demonstration of the Peacekeeper. Seeking to have a closer look at the Peacekeeper, Toby enters the same room as the robot, only for the Peacekeeper's first attempt to destroy the barrier to backfire with the result that Toby is totally annihilated. After the Peacekeeper is stopped by security forces, Dr. Tenma, wracked with despair, builds an identical robot clone of Toby, using DNA from a strand of his hair to obtain his memories, which will make the robot think he "is" Toby. He also powers the robot with a positive blue core. The robot quickly comes to life, and Tenma brings him home.