It turns out that Andi is actually Rama's estranged brother, andthey end up joining forces to kill Mad Dog. It turns out that Lieutenant Wahyu was corrupt, but Wahyu takes Tama hostage so he can get out. They are encountered by Andi and Rama in the stairwell, and after Wahyu learns he will never be considered an equal by his superiors, kills Tama and attempts to kill himself too, but had accidentally used his last bullet on Tama. Andi is now head of the underworld and declines Rama's pleas to leave with him. Andi gives Rama, Wahyu, and Bowo - the only cops remaining alive - safe passage from the compound (and gives Rama a tape with evidence of each cop on Tama's payroll, leaving it to Rama as to how and whether to expose them).
Rama (Iko Uwais) is a rookie cop who trains incessantly. His wife is pregnant and he is trying to make a better world for her and their baby. He is assigned to a rookie squad led by experienced Sergeant Jaka and his second in command Bowo. Jaka's squad rendezvous with Lieutenant Wahyu - who has received orders to infiltrate the 15-story compound/meth lab run by underworld kingpin Tama (Ray Sahetapy). Tama is assisted by his right-hand man Andi (Donny Alamsyah) and psychotic enforcer Mad Dog (Yayan Ruhian). The mission is incredibly dangerous as most of the tenants are killers, assassins, drug dealers, and/or on Tama's payroll. Not every tenant is a bad person though, and Rama stops Bowo from assaulting an innocent man who stumbles upon them while bringing medication up to his sick wife. The mission goes well initially, but after Jaka allows a child to proceed to the exit, the kid betrays them and sounds the alarm before Wahyu kills the child.
Tama immediately springs to action, offering free lifetime rent to anyone who kills a cop. He also orders snipers to take cops out when they pass windows and has some of his gang leaders kill the drivers of the police transport. After an intense battle, only five policemen are left alive. Rama and a severely injured Bowo are separated from Wahyu, Jaka and another officer named Dagu. Rama ends up battling his way to the room of the man with the sickly wife who eventually lets them in so they can avoid detection by the other residents. Meanwhile, Jaka pleads with Wahyu to order backup so they can retreat, but Wahyu unveils that the mission is unauthorized and they can't get backup. Meanwhile, Tama dispatches Andi and Mad Dog to kill each respective group, but as soon as Mad Dog and Tama are out of sight, Andi kills his cohorts.
Rama leaves Bowo to recuperate in the friendly tenant's apartment before leaving to find the other survivors. He encounters stiff resistance and is almost killed in the struggle. Andi comes across Rama while Rama is virtually unconscious... and brings Rama to safety. It turns out the two are brothers. Rama signed up for the mission to save Andi, but Andi enjoys the success he has attained working for Tama. Andi offers to help Rama escape, but the offer is refused because he needs to find his fellow cops. Andi is clearly worried about Rama's chances of survival, and seems emotional when he is told he will be an uncle soon. Meanwhile, Wahyu seeks to escape with Jaka and Dagu, but Jaka refuses to abandon Rama and Bowo. The three leave their hiding space to search for them, and immediately run into Mad Dog and his thugs. Wahyu immediately runs away and Jaka orders Dagu to protect him while he takes on Mad Dog. Though Jaka is significantly bigger and stronger, Mad Dog kills him in battle, snapping Jaka's neck.
Ultimately, Rama reunites with Dagu and Wahyu, having seen Mad Dog dragging Jaka's dead body throughout the complex. Wahyu again wants to flee, but Rama notes that the only way they can get out alive is if they actually complete their mission and capture Tama. Meanwhile, Tama observed Andi through hidden video monitors, and orders Mad Dog to torture and kill Andi. Dagu, Wahyu and Rama first take out the meth lab and then are left with a clear path to Tama's HQ. On the way, Rama sees Mad Dog beating Andi, and goes off to confront him while Wahyu and Dagu go to confront Tama.
Mad Dog decides to fight Rama and Andi simultaneously. Against all odds, Mad Dog beats both Andi and Rama. While he is trying to kill Rama, Andi manages to stab Mad Dog in the neck, weakening him enough for the brothers to gain the upper hand and kill him. Meanwhile Wahyu takes Tama into custody before shooting and killing Dagu. Wahyu intends to use Tama as a hostage to escape the building after he kills Rama too. It turns out that Wahyu was corrupt and on Tama's payroll and set up the mission to attain glory. Tama realizes that Wahyu orchestrated this whole thing to impress his bosses, and begins mocking him for being inferior. Realizing that there is no honorable way out, Wahyu shoots Tama dead and tries to kill himself, but is out of bullets having inadvertently used his last one on Tama. Nobody else is aware of Andi's betrayal of Tama, so Andi is now the head of Tama's underworld. He calls off the attack on the police and Rama takes Wahyu into custody.
Andi walks Rama, Wahyu and Bowo out of the complex. Rama asks Andi to come with him and return home, but Andi sadly declines, saying he is a wanted criminal. Andi notes though that Rama is not the only good cop left, and gives Rama a tape of evidence Tama kept of every corrupt cop on Tama's payroll. The brothers walk off - Andi back to the criminal underworld, and Rama back to his family and police life. It is unclear what Rama will do with the evidence, if Andi can reform the underworld, and whether the brothers' paths will cross again.