In a Philadelphia home invasion, Clarence Darby murders the wife and daughter of engineer Clyde Shelton, who is forced to watch. Prosecuting attorney Nick Rice is unable to securely convict Darby due to mishandled evidence. Unwilling to risk lowering his high conviction rate, he makes a deal with Darby: in exchange for testifying against his accomplice, Rupert Ames (who only intended to steal from Clyde and flee), Darby will plead guilty to third degree murder and receive a lighter sentence. Ames is convicted and sentenced to death, while Darby is released after a few years. Clyde feels betrayed by Nick and the justice system.
Ten years later, Ames is executed via lethal injection; due to a chemical alteration, he dies in agonizing pain. Evidence implicates Darby. An anonymous caller alerts Darby as the police draw near and directs him to a remote location. Clyde, disguised as a police officer, reveals himself as the caller and paralyzes Darby with tetrodotoxin. He straps Darby to a table, makes medical preparations to prolong Darby’s suffering, and then video-records himself dismembering and killing him. When Darby’s remains are found, evidence ties his death to Clyde; Clyde willingly surrenders and goes to prison.
In prison, Clyde demands a new mattress in his cell in exchange for a “confession.” Nick initially refuses, but after learning that Clyde sent Nick’s family the snuff film of Darby’s murder and traumatized them, District Attorney Jonas Cantrell orders Nick to make the deal. In court, Clyde represents himself and successfully argues he should be granted bail, then berates the judge for accepting the legal precedent he cited, believing her too easily convinced and eager to let madmen and murderers back on the street. The judge cites him for contempt of court and orders him to be jailed.
After giving Nick his confession, Clyde demands an elaborate steak lunch and a music player be delivered to his cell by a specific time, in exchange for the location of Darby’s lawyer, who was reported missing. Nick agrees, though the lunch is delayed a few minutes by the warden’s security measures. Once he has his meal, Clyde provides the location of the lawyer. Rice finds him buried alive, but too late to save him as was suffocated by time-mechanized materials while Clyde’s lunch was delayed. After sharing his meal with a cellmate, Clyde proceeds to kill him with his steak bone, forcing the warden to secure him in solitary confinement.
Cantrell arranges a meeting with a CIA contact and brings Nick. They learn Clyde previously worked with the agency, creating imaginative assassination devices and orchestrating intricate lethal tactics against nearly impossible targets. They are warned Clyde can kill anyone anytime he wishes and that if he is in jail, it is all part of a bigger plan. During a meeting with Rice and Cantrell, the judge is killed by an explosive hidden in her cell phone. Clyde explains to Nick that the murders are not about revenge, but the failures of the justice system. He then demands to be released and all charges against him dropped or he will “kill everyone”.
Nick takes precautionary measures instead. After Clyde’s deadline passes, a number of Nick’s assistants die from car bombs. Nick meets with Clyde in private, beats him, and yells at him in frustration that if they had tried to convict Ames and Darby, they might have gone free. Clyde counters that Nick did not care and that if he had at least tried but failed, Clyde would have accepted it. Nick demands an end to the killings, but Clyde tells him that he is just beginning to destroy the corrupt system and all who believe in it. While leaving the funeral of a colleague, Cantrell is killed by a weaponized bomb disposal robot. The irate mayor puts the city on lockdown and promotes Rice to acting District Attorney.
Nick learns that Clyde owns an auto garage near the prison. A tunnel leads to a cache of guns, disguises, and other equipment below the solitary confinement cells, with secret entrances to each cell. He realizes that Clyde wanted to be in solitary confinement all along; this allowed him to easily leave the prison without detection and carry out his pre-meditated murders while misleading the police, who have assumed his murders to be the work of accomplices. Evidence points to Clyde’s next target, City Hall, where the mayor is holding an emergency meeting. Nick and his men cannot find Clyde, but discover a cell-phone-activated suitcase bomb planted in the room directly below the meeting.
Clyde returns to his cell and is surprised to find Nick waiting for him. Clyde suggests another deal, but Nick, having finally come to understand him, says he no longer makes deals with murderers. Nick tries to reason with Clyde, but Clyde activates the suitcase bomb, causing Nick to flee. Clyde realizes too late that Nick moved the bomb to his cell, which is now sealed. Accepting his fate, Clyde smirks at having finally taught Nick that one has to work outside the system to stop some people, before sadly staring down at his daughter’s bracelet as the bomb explodes, killing him.
The epilogue shows Nick watching his daughter in a musical stage performance, an event for which he previously had difficulty finding time.