Gun
(2010)

Angel Hawkins (Val Kilmer) is actually working undercover for Detective Rogers (James Remar) to bust Rich Taylor (Curtis "50 Cent" Jackson) and his supplier to be Sam (John Larroquette) in exchange for his freedom.

Angel gives Rogers the location of the bust and Rich's crew and Sam's security are killed by police. Rich follows Angel believing he is making them another escape route. However, Angel pulls a gun on Rich and explains that Rich killed his wife during the assassination at the club in the opening scene. Rich tries to kill Angel, but Angel wounds him. Unable to kill him, Angel is shot by Rogers.

Angel is only wounded by the gunshot and leaves the hospital a free man, reunited with his daughter. Detective Rogers is last seen tearing the case board in his office down in anger as while Rich was arrested, Sam was given a plea deal (most likely for little to no jail time) due to his implied government ties. Rich is last seen in jail, most likely for life for his various murders and other crimes.

Thanks Spectre!