In the year 2035, robots are commonplace, doing all forms of jobs from factory work to mail delivery. On the day before the release of the new Nestor Class 5 (NS-5) Chicago Homicide Detective Del Spooner receives a call that his old friend Doctor Alfred Lanning (James Cromwell), inventor of the Three Laws of Robotics and co-founder of U.S. Robotics (USR), had been found dead. Surveillance footage initially suggest Lanning’s death is a suicide. However, Spooner, who has an intense distrust of robots, believes Lanning was murdered. With the help of Doctor Susan Calvin, he searches Lanning’s office where he finds an NS-5 and captures it after it fails to obey Doctor Calvin’s commands. During interrogation, the robot, who calls himself Sonny (Alan Tudyk), tells Spooner that he was built by Doctor Lanning himself and insists, when accused by Spooner, that he didn’t kill Lanning, visibly angered. Sonny also tells Spooner that he is capable of sleep and having dreams, but before Spooner can get any more information, USR CEO Lawrence Robertson (Bruce Greenwood) arrives with his lawyers and takes custody of Sonny.

After Spooner’s Commanding Officer John Bergin (Chi McBride) insists that the death was a suicide and that Spooner is getting nowhere in his investigation, Spooner decides to search Lanning’s home. As Spooner searches the house, a demolition robot with a command to demolish the house the next morning activates and destroys the house with Spooner inside. He manages to get out, but is unable to convince Doctor Calvin of his suspicions. On his way home, Spooner is approached by two USR trucks and attacked by the NS-5s inside, causing an accident. Spooner fends off an NS-5 with his cybernetic left arm, but when the police arrive, the NS-5 destroys itself while other robots clean up the remains of the accident. Spooner is unable to convince Bergin of the truth and is relieved of duty.

…

After escaping Robertson’s office with Sonny’s help, Spooner decide to use nanites designed to decommission robots to destroy VIKI. Sonny is sent to get them, since his dense alloy can withstand the force field protecting the nanites. Meanwhile, Calvin’s attempt to open the hatch to VIKI’s mainframe is thwarted by more NS-5s. When Sonny arrives, Spooner orders Sonny to give him the nanites and rescue Doctor Calvin. Spooner successfully destroys VIKI, returning the NS-5s to normal. Concluding that Doctor Lanning ordered Sonny to kill him after designing Sonny as a safeguard against the coming rebellion, Spooner dismisses the charges against Sonny under the pretense that murder can only happen between two humans.