Mystic River (2003) ending / spoiler

Dave (Tim Robbins) reveals that he didn't kill Jimmy's (Sean Penn) daughter - he actually killed a child molester. Celeste had suspicions that Dave was the one who killed Katie, and tells of this to Jimmy, and he gets the Savage brothers with him at the bar. They confront Dave and tell him to confess. Dave tries to defend himself, telling him that he killed a child molester instead. Jimmy still doesn't believe him, and tells Dave that if he admits that he killed Katie, he'd let him go. So Dave makes up a lie and says that he killed her. Then Jimmy stabs and shoots him and throws him into the river. The next day, Sean (Kevin Bacon) tells Jimmy that the real killers were Brandon's younger brother, Silent Ray and his friends. He also tells him that Dave is missing, but then realizes that Jimmy had killed Dave.