The climax reveals that Lieutenant Dane Dumars (Matt Damon) was never corrupt. Following the murder of Captain Jackie Velez, Dane suspected a leak within his unit. Upon discovering the $20 million in the Hialeah attic, Dane deliberately told each team member a different dollar figure for the seizure.
When corrupt DEA Agent Matty Nix (Kyle Chandler) calls into the house demanding a specific, incorrect cash figure, Dane instantly identifies Detective Mike Ro (Steven Yeun) as the mole, as Ro was the only officer given that specific number. During a staged physical altercation with J.D. Byrne (Ben Affleck), Dane secretly lifts Ro's burner phone to confirm the betrayals.
While Dane and J.D. draw fire inside the house from attacking corrupt officers and cartel gunmen, Detectives Numa Baptiste and Lolo Salazar quietly slip out the back, transporting the actual cash in their vehicle alongside Wilbur the dog directly to federal headquarters. The official federal count matches Dane's reported sum ($20,650,480) down to the dollar, completely exonerating Dane and J.D. while Mike Ro and Agent Nix are taken into custody.