A Time To Kill
(2005)

When Carl's (Samuel L. Jackson) 10 year old daughter is kidnapped and raped by two drunk rednecks who look likely to escape much jail time, he charges into the courthouse and kills them, as well as accidentally injuring a policeman (Chris Cooper). His lawyer Jake (Matthew McConaughey), best friend (Oliver Platt) and law student Ellen (Sandra Bullock) work to get him freed under the plea of not guilty by reason of insanity while the D.A. (Kevin Spacey) seeks the death penalty.

Everyone in town knows Carl did it, he freely admits to it, and the plea is an attempt to let the jury let him off under the guise of a legal basis when really they hope that the jury will feel, as Jake does, that he was justified. Racial tensions skyrocket and the KKK moves into town at the bequest of one of the slain redneck's brother Freddie (Keifer Sutherland). Ellen is kidnapped by the KKK and left to die, but one of the members relents and comes back to help her. Jake's house is burnt down and the husband of his secretary dies after being beaten by the KKK.

In the end Carl is found not guilty and Freddie and some of his compatriot are arrested (for what is not spelled out, but one assumes for Ellen's kidnapping and attempted murder).

Thanks Mary C!