Ray Breslin (Sylvester Stallone) is a consultant for the Federal Bureau of Prisons. His job is to test the efficiency and escapability of America's most secure prisons. Ray has adopted a false identity and landed himself in a federal penitentiary in Colorado. He sits alone in his cell and listens as his cellmate whispers a message to him through the wall: another prisoner intends to stab Ray to death in the yard the next day. Ray sighs upon hearing the news. The following day, Ray is assaulted by a pair of white supremacists. He deflects the prisoners' attacks and ultimately injures the pair of them. Shots ring out and armed guards storm the yard. Ray is hauled to a tiny, cramped isolation cell. His only belonging is his bible. A closed-circuit surveillance camera watches Ray's every movement. Over the next few days Ray takes note of the guards' routines. At least once a day the two guards who monitor the isolation area leave their post for a seven minute smoke break. The guards bring Ray his lunch which consists of, most importantly, a carton of chocolate milk. He dissects the cardboard milk carton and extracts a transparent plastic sheet from the label. The following day, when he's escorted out of his cell, he secretly applies the plastic film over the keypad which accesses his cell. The guard punches in the 4-digit access code, leaving his fingerprints on the film. Ray sneaks the film from the keypad, stuffs it in the bible, guesses the access code from the fingerprints and waits for the right moment to escape.
A pretty woman, in a brunette wig and sunglasses, steps out of her towncar which she's parked near the prison. She walks away from the car, presses a button on a remote, and triggers the firebomb hidden within the car. Ray hears the explosion, which has been timed to occur during the guards' smoke break, and quickly exits his cell. He runs to the guards' control room, finds his video feed playing on a closed-circuit monitor, and rewinds the feed a few hours. He stealthily makes his way through the prison, and ultimately arrives at the prison's fire station. There, he dons a yellow fireman's uniform, clings to the bottom of the responding fire engine, and exits the prison to the exterior parking lot, where he easily steps into a waiting van and makes his escape. Inside the van are Ray's two associates: Abigail Ross (Amy Ryan) and "Hush" (50 Cent). Abigail and Hush joke with Ray, complimenting him on escaping yet another prison, and teasing him. They drop off Ray at a service station a few miles from the prison and drive off. Ray walks to a phone booth, dials a number, and watches as a highway patrolman rolls past. The cop spots Ray's prison jumpsuit and screeches to a stop. He calls in for backup and within seconds Ray is surrounded by Colorado's finest. Ray's contact answers, and Ray tells him that it's finished.
Ray returns to the prison, dressed in a nice shirt and slacks, and is accompanied by his associate and business partner Lester Clark (Vincent D'Onofrio). Lester is, as he describes to the warden, the numbers guy of this partnership and Ray is the artist. Ray is hired by the government to break into its prisons and expose their flaws. Ray describes to the Warden, in detail, how easy it was to break out of his prison. The warden, dumbfounded, makes note of Ray's criticisms and escorts them out.
Los Angeles. Breslin & Clark Consultants is a profitable, well-oiled security company. Ray and Abigail have some chemistry, and Hush proves to be an extremely competent computer specialist. Ray walks to his office, which he rarely visits (most of his work time is spent in a prison cell), and is summoned by Lester to the conference room where a CIA officer is waiting for him. CIA representative Jessica Miller (Caitriona Balfe) has been sent to Breslin & Clark with a unique job proposal. The CIA, since 9/11, has been under great scrutiny for its treatment of enemy combatants. They've been trying to find a secret way to deal with undesirables that doesn't alert the ACLU. Therefore the CIA has created a new prison whose location, for the purposes of secrecy, cannot be disclosed to Ray or his team. Its whereabouts and functions are beyond top secret, but the CIA promises if Ray can successfully escape, they will gladly double his $2.5 million fee. Abigail and Hutch are reluctant to accept the job, but Lester convinces Ray that a $5 million payday is worth his trouble. Ray agrees to the operation. Jessica provides Ray with a cover ID: a Spanish-born explosives terrorist named Portos. Her team will be waiting for him in New Orleans in a few days.
Ray, Abigail and Hush rent a room at a Bourbon Street hotel and count the minutes until the pick-up time. Abigail and Hush are still uneasy about the ramifications of the mission and finally convince Ray to wear a tracking device. Ray succumbs to the suggestion and is injected with a microscopic tracking chip in his arm. Ray teases Abigail, insists that he'll be fine, and walks down the street to be picked up. Within moments a black van swings around the corner, a homeless man tazes Ray, and he's tossed into the back of the van. Armed militia types pull guns on Ray and wave an electronic wand over his body. As it crosses over his shoulder, it beeps, and using a pocket knife they dig the tracking device out of his arm. They stick a syringe in Ray's neck and he passes out. Back at the Bourbon Street hotel, Ray's tracking marker disappears from the team's laptop, to both Abigail's and Hush's frustration, and Ray's location is officially unknown.
Ray awakens in a very groggy state, in the back of a helicopter. Through blurry eyes he watches as the lead militia guard, Drake (Vinnie Jones), excitedly stabs another inmate in the stomach before throwing him out of the helicopter's open door. Drake notices Ray's open eyes and orders his subordinate to knock him out again. Ray wakes up, finally, in his prison cell; its worse than he thought. His prison cell is a Plexiglas cube hanging twenty feet in the air along with dozens of other similar cubes. The guards wear black masks and identical jumpsuits to conceal their identities, and they don't hesitate to brutally beat any prisoner who disobeys them. For the first time in his career, Ray has no idea how he's going to escape. Ray is brought to the warden's office and is surprised to meet someone he was not expecting. Willard Hobbs (Jim Caviezel) is a cold, menacing authority figure who cares little for the welfare of his inmates. Ray, overwhelmed by the complexity and brutality of the mission, gives Hobbs a bug-out code (a number issued to him by the client which he can use when he gives up -- a game over card) but Hobbs doesn't care. He tells "Portos" that he's never getting out of his prison. Ray learns a lot on his first day in the prison. It appears that the prison isn't exactly made up of law-breakers. Many of its residents made enemies on the outside; enemies who paid Hobbs, and his organization, millions of dollars to incarcerate them. One of the first prisoners "Portos" meets is German-born Emil Rottmayer (Arnold Schwarzennnegger) -- an aged associate of the infamous European financier "Mannheim". Mannheim has made a lot of enemies, but has always managed to evade them. Rottmayer was taken by Mannheim's enemies, and incarcerated in Hobb's secret prison. Rottmayer is eager to associate himself with Portos and tells him that he is known to be a "favor guy" in the prison. If Portos needs anything, Rottmayer can get it for him... for a price. Portos/Ray, only eager to escape, tells Rottmayer that he needs to see solitary confinement. Rottmayer jokes with Portos/Ray and picks a fight with him in the mess hall. Before too long a riot breaks out among the prisoners and masked guards pour into the mess hall. Rottmayer and Portos/Ray are hauled to isolation and the pair are shoved into tiny, cramped metal boxes illuminated by bright, blinding spot lights -- torturous easy-bake ovens. The pair sweat for many days, until the prison doctor, Emily Kyrie (Sam Neill), is called in by Hobbs to check their condition. Hobbs is fine with letting prisoners suffer, but a dead prisoner means refunding the client. Ray, sensing a conscience in Dr. Kyrie, pleads to know where they are and where the prison is. Dr. Kyrie refuses to tell him, but when asked by Hobbs what Ray asked, Kyrie lies, saving Ray from more time in the box. Ray and Rottmayer are sent back to general population and Rottmayer asks what information Ray was able to gather while in the box. Ray tells him that, judging by the humidity of the boxes, they're probably somewhere underground; possibly in an underground lake that was repurposed into a prison. There was a flaw in the boxes' design. The boxes are made of steel, which does not cope well with humidity. Ray's box had an access door at its bottom, held in place by four steel screws. If Ray could concentrate enough heat on those rusty screws, they should come loose, allowing Ray to escape the box, but in order to super-heat the screws, he'll need a flat, circular metal disc. Rottmayer volunteers to procure one for him.
Rottmayer asks to speak with Hobbs and is taken, by guards, to his office. Hobbs is eager to speak with Rottmayer, because his sole knowledge of Mannheim's whereabouts would mean a big payday for Hobbs. Hobbs asks Rottmeyer, repeatedly, where Mannheim is. Rottmayer asks for a pad of paper and a pencil and draws a crude image of an arrow point up a cartoon character's butt. Hobbs, enraged, orders his men to beat Rottmeyer. Rottmeyer falls to the floor, and manages to steal a metal drain cover, and hide it in his hands as the guards beat him. He's escorted out of Hobb's office and taken back to genpop. Rottmeyer gives Ray the metal disc and asks him what to do next. Ray explains that he'll use his prison-issue toothpaste to super-polish the metal disc and make it as reflective as possible. He'll need to get back into his isolation box and he'll use the reflective disc to super-heat and dislodge the screws. Rottmeyer, realizing that they need to get back into the isolation area, picks a fight with the leader of the prison's Muslim population, Javed (Faran Tahir). A full-scale brawl erupts between the white supremacists and muslims, with Ray and Rottmeyer stuck in the middle. Ray balls-up a slice of bread and stuffs it in his jumpsuit. Dozens of inmates are hauled to isolation, including Rottmeyer and Ray. Ray is tossed into his hotbox and he secretly starts removing the box's screws. After many hours the screws come loose and the panel opens. Ray stuffs the balled-up piece of bread into the cell's camera lens and knocks on the wall, signaling Rottmeyer. At the knock, Rottmeyer begins to cry, hysterically, in German. The isolation guards, distracted by Rottmeyer's cries, pay no attention to Ray, who secretly opens the hatch and descends a long ladder far below his cell. Ray carefully navigates the complex tunnels and air ducts and ultimately arrives at a giant tube with an access hatch at its apex. He climbs the tube's piping and electrical cables and comes to the hatch. He opens it up, sees daylight above, steps out and discovers where the prison is. It's an oil tanker -- a giant merchant ship floating in the middle of the ocean. Ray is speechless. He nervously ducks out of sight of a few oncoming guards, and after taking in his geography, he jumps back into the tube and slowly makes his way down into the ship. Along the way his foot slips, cracking open water pipes which begin to fill the tube and air ducts with water. Back in the isolation area, Hobbs has arrived to diagnose Rottmeyer's hysterical ramblings. Ray is having difficulty reaching his isolation cell. Much of his way back is under water. Back in the isolation area, the other prisoners watch as sea water floods their cells. The guards are overwhelmed by the panicked prisoners and begin releasing them from the boxes one-by-one. They come to Ray's box last, and Ray barely manages to make it back into his cell, take the bread from the camera, and close the access panel beneath him, before his door flies open and he's yanked out of the cell by the guards. The prisoners are returned to general population while Hobbs and Drake try to find the source of the flood. They come to Ray's cell and notice a single rusty screw sitting atop the access panel. Drake suggests that the flood must have dislodged it. Hobbs doesn't buy it. He orders Drake and his men to make Ray's life a living hell.
Back in Los Angeles, Abigail storms into Lester's office, carrying the multi-million dollar check issued by the CIA -- it's been frozen. Lester doesn't seem concerned and tries to convince Abigail to let it go. She's so worked-up about Ray that she's becoming suspcious of everybody. She leaves Lester's office, but talks with Hush. Hush does some internet research and comes across the concept for a prison that is identical to the one that's holding Ray. The only problem is that the prison's location is unknown.
Back in the mess hall, Ray delivers the bad news to Rottmayer: they're in the middle of the ocean, with no recognizable landmarks within viewing distance, aside from the stars. Ray believes, if he can get a hold of a few regular objects, he can MacGyver-together a sextant which they can use to determine their location. Ray hurriedly constructs the sextant, and passes it to Rottmeyer seconds before he's accosted by a trio of Hobb's guards. For the next several days, Ray can't sleep, eat, walk, or breath without the guards assaulting him. Ray and Rottmeyer determine that they'll never have an opportunity to get outside to use the sextant, but that someone else might. They go to Javed, who is still fuming from his recent stay in the box, but Rottmeyer convinces him to their cause by promising to break him out of the prison. They tell Javed to tell Hobbs that Ray is planning to escape, and that he'll continue to give Hobbs information on the escape in exchange for the opportunity to do his daily prayers outside, in the open air. Hobbs agrees and gives Javed his pass to the outside. Back in Hobb's office, he speaks on the phone to an unknown party who reveals that Portos is actually famed prison-escaper Ray Breslin. It's revealed to be Lester, who is speaking to Hobbs. Lester tells Hobbs that he can keep Ray in the prison for the rest of his life. Hobbs summons Ray to his office and reveals that he knows his true identity, and boasts that he designed his inescapable prison after reading Breslin's own published book about escaping prisons. Ray, who still needs the escape to go to plan, lies to and offers to work with Hobbs, to get information on Mannheim from Rottmayer. That night, Javed prays on the deck of the ship, and as the guard turns away, he hurriedly looks through the sextant at the stars and marks their location, in degrees, on Ray's map. The information is returned to Ray who, upon factoring in the location of the stars, proximity to land for supplies, and the weather and temperature of the ocean, suggests that they're somewhere off the coast of Morocco. Now that they know where they are, all they need is a message to the outside world, and for that they'll need to convince Dr. Kyrie to aid them. While standing in line, Rottmayer stabs Ray in the leg which prompts a visit to the infirmary. At the infirmary, Ray has his leg stitched up, without the aid of pain killers (another ruthless rule of Hobb's). Ray convinces Dr. Kyrie to remember the hypocratic oath he took as a doctor. Furthermore he tells Kyrie to go to Hobbs' office and to read a passage on a particular page in Breslin's book to confirm Ray's identity and story of innocence. Kyrie ultimately is convinced by Ray and agrees to send out one coded e-mail, to Rottmeyer's people, with his whereabouts.
Back in general population, Ray, Rottmayer and Javed set in motion plans to distract the prisons' guards and allow them a window to escape to the surface. Ray and Rottmayer are a part of cellblock A, and Javed and the rest of the Muslims are a part of cellbock C. Their plan is to make the guards assume that a riot will occur in cellblock C, reducing their numbers in cellblock A where the riot will truly occur. The riot begins in cellblock A, and the understaffed guards are soon overwhelmed by the attacking inmates. Ray, Rottmayer and Javed take out multiple guards, steal their guns, and synchronize their watches. Rottmayer's people, who were alerted by Dr. Kyrie, are flying toward the ship in an attack helicopter. They'll be there in 11 minutes, and the three will have a brief window to escape. The trio makes their way up a service ladder and finally to the hatch just below the surface. Hobbs, who had been alerted to the riot in cellblock A, orders a full shutdown of the prison. With a click, blast doors close all over the prison, and the surface hatches are magnetically snapped shut. The trio reach the hatch seconds after it locks. They're trapped. The three descend the ladder and hide as time ticks away. Ray tells Rottmayer and Javed that he will go to the engine room in the bowels of the ships, where he should be able to restart the ship's electrical system, and cause the surface hatches to temporarily unlock. Hobbs' guards find the trio and open fire. Rottmayer and Ray shoot back, but Javed takes a bullet to the stomach and falls to the ground. Ray gives Javed his gun, tells Rottmayer to take care of him and runs to the engine room. Rottmayer looks at his watch, and Javed, who realizes that they're running out of time, asks for Rottmayer's gun and tells him to climb the ladder. Javed heroically takes out dozens of guards with the pistols, before being shot and killed by Hobbs' men.
Ray arrives at the engine room, meets minimal resistance, and manually turns off the ship's cache of batteries. One by one, lights and electrical systems turn off in the prison and the surface hatch opens for Rottmayer. Rottmayer emerges from the hatch and hides as guards, on the bridge, open fire. Down below, in the engine room, Drake corners Ray and the two engage in a bloody fistfight. Ray manages to kick Drake down a flight of stairs, where he breaks his neck and dies in a puddle of blood. On the surface, Rottmayer's men in an attack chopper, have arrived and open fire on the bridge and its guards. They hurriedly land the chopper, and beg Rottmayer to jump in so they can take off, but he refuses -- they can't leave without Ray. Rottmayer mounts a machine gun and mows down waves and waves of guards. Hobbs arrives at the engine room, but Ray is nowhere to be seen. He's hidden himself inside of a water tank, half-filled with sea water. Hobbs orders his men to turn the ship's systems back on one-by-one. The water tank quickly fills with water, and within seconds Ray is submerged up to his hair in water. As Hobbs continues his search for Ray he doesn't realize that the water tank automatically flushes itself out when it reaches a certain volume. The water tank is emptied into the ocean, and Ray with it. Back on the surface, Rottmayer and the helicopter pilot take off, and circle the ship, trading gunfire with guards and looking for Ray. Ray surface, in the water, and Rottmayer orders his man to drop a rope ladder. Hobbs appears on deck and orders his men to open fire on the helicopter. A gunfight ensues between Rottmayer and Ray on one side and Hobbs and co. on the other. Rottmayer manages to toss Ray, who is dangling from a string, a pistol. Ray fires at a pallet full of explosive tanks seated directly beneath Hobbs. The tanks explode, taking Hobbs with them, allowing Ray and Rottmayer a window to escape to Morocco.
The helicopter hovers over the Moroccan beach and the pair of Ray and Rottmayer jump out onto the sand. Ray, confused, asks where Mannheim's people are, and Rottmayer reveals the truth -- he is Mannheim. A pickup truck, with a pair of armed soldiers pulls up to meet them. The driver exits the truck and opens the back door, and out steps Mannheim's daughter, Jessica Miller -- the CIA agent who brought the job to Breslin and Clark in the first place. Mannheim/Rottmayer reveals that they knew if anyone could break out of Hobbs' prison, it was Ray Breslin, and they concocted this mission to get him out. Mannheim/Rottmayer climbs into the pickup with his daughter, asks Ray if they can give him a ride, which he refuses, and they drive off.
Ray Breslin returns to Los Angeles, where he's met by Abigail. Abigail reveals what she and Hush discovered. Hobbs' illegal prison organization contacted Breslin & Clark so they could get infamous prison escaper out of the picture. They contacted Lester, and offered him a seven-figure salary with a job like Hobbs', in exchange for Ray. In fact, Lester has a business meeting, at that exact time, with the company in Miami. In Miami we watch as Lester Clark steps into a high rise elevator with a briefcase and exits to the parking garage. He climbs into his luxury sedan, and is about to drive off when Hush appears in the backseat, and knocks him out. Hours later, Lester awakens in his car, in a pitch black room. He attempts to open his doors, but they're pinned shut by the room's walls. The camera pulls-out revealing that Lester, and his car are trapped inside a storage container, stacked atop hundreds of others on a cargo ship similar to Hobbs'.
Back in Los Angeles Ray and Abigail exchange flirtatious jokes and walk through an airport hangar to a waiting private jet.