Talented barrister Will Burton (David Tennant) is known for never losing a case and being able to get criminals out of "tight legal corners". On the verge of applying for the title of QC, Burton agrees to defend murder suspect Liam Foyle (Toby Kebbell), of whose innocence he is in some doubt. Having examined the evidence, he recognises a loophole, and Foyle is acquitted on a technicality.
In revenge for a perceived slight from Burton, Foyle begins stalking Burton's wife (Ashley Jensen) and young son. When Burton arrives at their holiday home, he finds his wife brutally murdered and his son in shock; he sees Foyle outside the house. Maggie Gardner (Sophie Okonedo), who has lived her professional career in Burton's shadow, takes up Foyle's defence. The prosecution team consists of two of Burton's colleagues, but he has little confidence in them and begins to carry out his own investigation. In the course of this, he discovers that the woman who has provided Foyle's alibi is also looking after Foyle's possessions in a storage unit. On searching the unit, police find evidence against Foyle. Burton's son finally describes his experience, which leads to the discovery of DNA evidence.
Maggie manages to discredit the evidence against Foyle, and he is acquitted, but she becomes increasingly unsure when Foyle begins stalking her too. Burton follows Foyle to Scotland and confronts him in the hope of getting a confession; a sequence of events leads to Foyle's death, and Burton is charged with murder, and elects to defend himself in court.