Wealthy, brilliant, and meticulous Ted Crawford, a structural engineer in Los Angeles, shoots his wife and entraps her lover. He signs a confession; at the arraignment, he asserts his rights to represent himself and asks the court to move immediately to trial. The prosecutor is Willy Beachum, a hotshot who's soon to join a fancy civil-law firm, told by everyone it's an open and shut case. Crawford sees Beachum's weakness, the hairline fracture of his character: Willy's a winner. The engineer sets in motion a clockwork crime with all the objects moving in ways he predicts.
Ted Crawford shoots his unfaithful wife, confesses to the police - orally and in writing - but then pleads not guilty and opts to defend himself in court. The young DA assigned to the case, Willy Beachum, has had a successful career with a 97% conviction rate. Beachum however is actually on his way to a lucrative position in a big private law firm, but his desire to win keeps him on the case. What ensues is a battle of wits between the two as Crawford systematically destroys his opponents case.
In Los Angeles, the structural engineer Ted Crawford witnesses his wife Jennifer Crawford and her lover Lieutenant Robert 'Rob' Nunally in the swimming pool of a hotel. When Jennifer comes back home, he shoots her on the head and then he shoots three times against the windows. The gardener Ciro calls the police and the negotiator Rob, who does not know the last name of his lover, gets the murder weapon and a confession from Ted. Meanwhile, the young and efficient but arrogant prosecutor Willy Beachum is resigning his position in the low-pay public service work to join the private civil-law firm Wooton Sims but decides to accept the case, which is his assessment is easily resolved. Ted asks the judge to represent himself in court and Willy accepts. But sooner the winner Willy learns that the evidences can not be accepted in the trial and despite knowing that Ted is the killer, the murder weapon is missing and he needs to get new evidences otherwise he will lose the case and Ted will be a free man.
LAPD detective Lt. Rob Nunally leads a squad investigating reported gunshots at the home of the wealthy Crawfords, husband and wife Ted and Jennifer. Nunally enters the house facing Ted holding a gun, he confessing to shooting Jennifer, who is lying unconscious or dead in a pool of her own blood a short distance away from him. As the police take Ted into custody, the police station where he will subsequently sign a written confession as to having shot Jennifer, other first responders find that Jennifer is still alive, although the eventual diagnosis is that, pending a miracle, she will not ever awaken from her coma, thus being placed on life support. The case is assigned to ambitious young deputy district attorney, Willy Beachum. Despite being a good lawyer, Willy has thus far scripted his own success - a 97% conviction rate - achieved somewhat by handing over unwinnable cases to other DDAs. This case will be his last in the DA's office as he has been hired by prestigious private firm, Wooton Sims. This move of being hired by a private firm is much quicker than most of Willy's predecessors and colleagues in the DA's office, again achieved partly on a calculated action on his part. Although Willy is unsure if he will see this case through to its conclusion, he is tasked to do so as the case looks to be concluded before he is scheduled to be at Wooton Sims. With Ted having made the verbal and written confessions and with Ted declining legal counsel in favor of acting as his own lawyer, Willy sees this case as a slam dunk in his favor despite one small hiccup regarding the supposed murder weapon. Despite Ted's seemingly crazy behavior, Willy will soon learn that Ted has a grand plan to win the case involving Nunally. As the case progresses, Willy has to decide how far he will go to get that conviction - it almost becoming a personal vendetta against Ted - losing which may not only threaten his new job at Wooton Sims, but his career as a lawyer, that is unless he can find that much needed evidence to put Ted away legitimately.
An attorney, intent on climbing the career ladder toward success, finds an unlikely opponent in a manipulative criminal he is trying to prosecute.
- Theodore "Ted" Crawford (Anthony Hopkins), a wealthy and talented structural engineer, discovers his wife Jennifer (Embeth Davidtz) is having an affair with police detective Rob Nunally (Billy Burke). Crawford proceeds to shoot his wife, seriously wounding her and he immediately confesses the crime to Nunally on the scene. However, at his arraignment, Crawford retracts his confession.
He then engages in a battle of wits with rising star deputy district attorney William "Willy" Beachum (Ryan Gosling), who considers this an open-and-shut matter and agrees to go to trial. Beachum is busy making preparations for his transition from criminal law to corporate attorney for Wooton & Simms, a well-known firm, and begins a romantic relationship with his future boss, Nikki Gardner (Rosamund Pike).
At the trial, Crawford acts as his own attorney, which serves as a key vehicle for the plot of the movie - matching up against a star prosecutor as a supposedly untrained litigant. Crawford reveals that the arresting officer (Nunally) was having an affair with his wife and was also present during his interrogation. His confession is ruled to be inadmissible as evidence, as it was fruit of the poisonous tree. Beachum discovers that Crawford's handgun was not used to shoot his wife, because it had never been fired and did not match the shell casings at the murder scene. Since the house was under surveillance the entire time from the shooting to Crawford's arrest, the police are baffled.
While the next hearing is imminent, Beechum is faced with absolutely no evidence against Crawford. Nunally in his intense desire for revenge, offers to plant false evidence through his contact at the evidence room. Beechum, however, being a young and as yet unspoiled lawyer refuses even to consider it. Nunally still goes on to do the dirty plant. Just before the trial, Beechum plots to trick Crawford with the help of his secretary, but at the last moment decides against it. With no new evidence to present to the jury, Beachum is forced to concede the trial and Crawford is acquitted. The disgraced Nunally commits suicide with his own gun outside the courtroom.
Beacham's future with the prestigious firm is in tatters. With the case closed, he obsessively continues to search for evidence. He repeatedly visits the comatose Jennifer in the hospital, hoping she will wake up. But at Crawford's request, a restraining order is issued, forbidding Beachum to visit the patient. Realizing that Crawford's plan is to dispose off the only eyewitness to the crime, Beachum goes to great lengths to get a court order to keep Jennifer on life support. Nikki refuses to help him and they end their relationship. Beachum arrives too late and Crawford orders the hospital staff to take Jennifer off life support, allowing her to die.
A mix-up of cellphones leads Beachum to realize that both Nunally and Crawford used similar guns. He figures out that before the crime, Crawford switched his gun with Nunally's identical Glock 21 in a hotel room where Jennifer and Nunally secretly met. Crawford shot his wife with Nunally's gun, whereupon the detective arrived on the scene carrying Crawford's gun. While Nunally lingered over Jennifer, trying to revive her, Crawford reloaded Nunally's gun and placed it back where Nunally had left it, while at the same time taking back his original gun. Distracted by the sight of Jennifer's body, Nunally did not notice the guns being switched back. When Crawford appears back in the room brandishing his own gun, Nunally tackles and beats him up before Crawford is arrested, at which point Nunally unwittingly holsters his own gun, the murder weapon, and lets Crawford's unused one to be taken as evidence.
Beachum confronts Crawford with his new evidence. Since she died, the bullet lodged in Jennifer's head can now be retrieved and matched with Nunally's gun. Beachum tricks Crawford into confessing, knowing that Crawford thinks he is protected under the double jeopardy clause. However, Beachum reveals that by allowing his wife to die, Crawford can now be prosecuted for murder, having previously been tried merely for attempted murder. If he had not pulled Jennifer off life support, he would have been protected by the double jeopardy clause - and as per the doctors, Jennifer could have died anyway. Crawford is arrested by the waiting police.
The film ends with a new trial about to begin. This time, the defendant is surrounded by attorneys.