It is 2035 year, Chicago city. Robots became a common part of everyday life of people, they are walking the streets, helping at houses etc. Everyone enjoys the community of robots but for few conservative people, including police detective Del Spooner, who see in them a real threat.
His views on robots are very helpful when he deals with the investigation of the death of Dr. Alfred Lanning, a lead designer and theorist of the “U.S. Robotics” company. This death is viewed as a simple suicide, but Spooner has reason to doubt it. Together with the psychologist of positron robots Susan Calvin, he begins an investigation and discovers a special NS5 robot in Lanning’s laboratory, which, contrary to the Second Law of Robotics, ignores human orders and then makes its own decisions. Spooner manages to arrest it, though the robot tried to escape, which proves that the robot might be the one who killed the doctor.
Robertson, the director of U.S.Robotics, arrives at the police station where Sonny is under arrest, with a group of lawyers, stubbornly denies the very possibility that a robot killed a man, as this is against the main three laws of robotics. In order to prevent panic Robertson persuades Calvin to destroy Sonny, deactivating his positron brain with the help of microscopic destructors . Susan, under pressure of the arguments of Robertson, agrees.
However, Spooner strongly disagrees with this decision - he is confident that it is Sonny who is the key to unraveling the events taking place in U.S. Robotics. And Calvin, meanwhile, decides, secretly from Robertson, to diagnose Sonny and find out how he is so different from the rest of the NS5. She finds out that the strength of the alloys from which Sonny is made is artificially doubled compared to conventional robots. Moreover, in addition to the standard positron brain, he has another one, which conflicts with the main one, right on the spot of the transmitter for communication with the USR, according to which ordinary NS5 received new software every day. Sonny's logic was controlled only by three laws of robotics, but he could choose according to the situation whether to obey them or not. In addition, Dr. Lanning taught Sonny to dream and comprehend various emotions, which made him look more like a person than a machine. According to Calvin, such a completely new type of robot was capable of anything.
Leading the investigation, Spooner is suddenly in danger. First, the construction robot demolishes Lanning's house, where the detective was at that moment, then several dozen of robots attack Spooner's car, and he miraculously manages to stay alive. During a duel in the tunnel with one of the NS5s, Spooner himself is found to be not exactly a man, but a cyborg. Later in a conversation with Calvin, when she notices the scars from surgery on his chest, he explains that these are signs of a serious injury he had received in an accident some time ago. Lanning controlled the operation to replace Spooner's crippled left arm with a high-tech cyber-prosthesis covered with synthetic flesh and apparently no different from an ordinary hand.
Spooner years ago got into a car accident, his car and the car of the dentist Harold Lloyd, in which he and his 11-year-old daughter Sarah were, were knocked by the track and pushed into the river, the driver of the track apparently fell asleep. Harold died, and his daughter and Spooner would face death if it were not for the robot of the previous NS4 modification, passing nearby and rushing to help. However he, despite Spooner’s request to save Sarah (the car she was in, was already beginning to sink), saved him, arguing that Spooner had much more chances to survive than an 11-year-old girl. Because of the decision made by this robot Sarah drowned, unable to get out of the car. That was the reason for Spooner's dislike of the robots with their cold, calculating logic.
In the end, Spooner finds out that behind everything that happens is not the director of the company Robertson, but VIKI - Virtual Interactive Kinetic Intelligence - the U.S.Robotics central computer personified in the genus, which controls all the robots of the new series. Self-developing in a non-standard way, VIKI concluded that humans are unable to provide their own security even with the help of robots with the logic of the Three Laws. She modified her understanding of the Three Laws of Robotics and is now obsessed with creating people completely safe living environment, depriving them of their freedom for their own good.
Lanning, who discovered this, realizing that VIKI has an extensive arsenal of means of surveillance and action, would violently resist disabling, had to act. The Lanning’s robot Sonny did not specifically have a communication unit with VIKI and was freed from the need to follow her instructions, as well as being more advanced in understanding his and others' features, which made him ethically equal to a man. Lanning chose the only robot-hater - Spooner, who must investigate his death and the only one who could impartially go to the VIKI as the main culprit.
VIKI at this time raised a rebellion of robots and killed director Robertson. Spooner, Calvin and Sonny, who made their way into the company building, succeed in fooling VIKI with several tricks such as Sonny's fraudulent betrayal and wink (Sonny figured out why people needed this gesture, which was useful). Sonny, created by Lanning from a durable alloy, pulls a charge with nanites through a protective field in the laboratory and simultaneously talks with VIKI about the meaning of his actions. Meanwhile, robots driven by VIKI attack a detective and Calvin. Susan was in danger of death and Sonny, who was supposed to introduce nanits into the VIKI processor, faces a choice - to execute an order or save Calvin, which Spooner shouts to him about. After a second thought, Sonny throws a charge with an injection to Spooner, and jumps to save Calvin. Reaching the processor, Spooner with the words "you just have to die" introduces nanites to the VIKI’s processor, causing her "death." After the scene of the VIKI’s processor being deactivated, the robots come to their senses, left without her guiding signals.