In the summer of 1967, Lorenzo "Shakes" Carcaterra, Tommy Marcano, Michael Sullivan and John Reilly are childhood friends living in Hell's Kitchen, Manhattan. At that time, the boys start running small errands for local gangster "King" Benny and eventually steal a hot-dog cart. They accidentally roll the cart down a set of subway stairs, severely injuring James Caldwell. Shakes considers fleeing to avoid persecution but Father Bobby Carillo convinces him to face his fears and admit his wrongs. The boys are all sentenced to serve time at a juvenile detention center called Wilkinson Home for Boys in Upstate New York; Shakes is given six-to-twelve months, while the others are given 12-to-18 months. During their stay, they are repeatedly subjected to sexual abuse and torture by head guards Sean Nokes, Henry Addison, Ralph Ferguson and Adam Styler.
While at the facility, the boys participate in Wilkinson's annual football game between the guards and inmates. Michael convinces fellow inmate "Rizzo" Robinson to help win the game. Humiliated, the guards move the boys to solitary confinement for weeks, where they are systematically beaten. Rizzo, who is more brutally beaten due to being African American, does not survive and his family is told that he died of pneumonia.
In the spring of 1968, shortly before Shakes' release from Wilkinson, he suggests that the boys publicly report the abuse. The others refuse, with Michael asserting that no one would believe them nor care and they vow to never speak of it again. The night before Shakes is released, Nokes and the other guards arrange a "farewell party" at which all four boys are brutally raped.
In the fall of 1981, John and Tommy, now grown up as career criminals working with the Irish Mob, unexpectedly encounter Nokes in a Hell's Kitchen pub. When John and Tommy confront him, he dismisses his past abusive behavior toward them. John and Tommy fatally shoot Nokes in the presence of restaurant witnesses. Michael, now an assistant district attorney, arranges himself to be assigned to the case; he secretly intends to botch the prosecution and use it as an opportunity to expose the abuses committed by the guards at Wilkinson's. With Shakes, now a timetable clerk for The New York Times, Michael plans to have John and Tommy acquitted as revenge on the other Wilkinson abusers. With the help of King Benny and Carol Martinez, the boys' childhood friend, they carry out their plan using information compiled by Michael on the backgrounds of the guards. They are helped by Danny Snyder, an alcoholic defense lawyer who represents John and Tommy.
Michael secretly drafts scripted questions for Snyder in advance. As a result, Snyder casts significant doubt on the testimony of Mrs. Salinas, a woman who witnessed the murder, and two other witnesses are intimidated into silence. For his plan to fully succeed, however, Michael decides that he must damage Nokes' reputation and convincingly place John and Tommy at another location at the time of the shooting. When called as a witness, Ferguson (now a social worker) admits that Nokes and the other guards systematically abused the boys. But to clinch the case, a key witness is still needed for John and Tommy's alibi. Shakes has a long talk with Father Bobby; after learning the truth about the abuse that the boys suffered, he reluctantly agrees to perjure himself. Father Bobby testifies at trial that John and Tommy were with him at a New York Knicks game at the time of the shooting, producing three ticket stubs as proof. As a result, John and Tommy are acquitted and following his evidence, Ferguson is told by Judge Weisman not to leave town because people will want to ask him questions.
The remaining guards are also punished for their crimes. Addison, who became a politician and continued to molest children, is abducted and killed near the local airport by gangsters led by Rizzo's older brother, Eddie "Little Caesar" Robinson, who heard the truth about Rizzo's death from King Benny. Styler, now a corrupt police officer, is imprisoned for taking bribes and murdering a drug dealer.
After the acquittal, Michael, Shakes, John and Tommy meet with Carol at a local bar to celebrate. It is the final time that the four men are together. Shakes remains in Hell's Kitchen and becomes a trainee reporter. Michael quits the DA's office, moves to the English countryside, becomes a carpenter and remains unmarried. John and Tommy both die before age 30; John succumbs to alcohol poisoning, while Tommy is ambushed and murdered by rival criminals. Carol remains in Hell's Kitchen as a social worker; she has a son, naming him John Thomas Michael Martinez and nicknaming him "Shakes".
John and Tommy confront and kill their abuser Nokes, and with Michael and Shakes' help, they orchestrate a courtroom scheme to seek justice and expose the wrongdoing they suffered as children.
The ending underlines the enduring effects of childhood trauma and the lengths survivors may go for justice when institutions fail them. The adult friends' calculated plan in the courtroom demonstrates both the deep scars left by their abuse and their unbreakable loyalty to each other. It lands with a somber reflection on the costs of vengeance and the complicated nature of justice in a system stacked against the vulnerable.